Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. XML / XSL
  4. XML+XSL Hyperlinks

XML+XSL Hyperlinks

Scheduled Pinned Locked Moved XML / XSL
questionxmlhelp
8 Posts 4 Posters 8 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Dominik Reichl
    wrote on last edited by
    #1

    Hello, this is a very basic problem, i think. How can I define an url in the XML file and format/output it with a XSL file? This is my XML file: Download 1 DWL1 link Download 2 DWL2 link2 This is my XSL file:

    Archive

    Downloads

    Name

    Webcode

    Goto

    []( WHAT HERE??? )

    What do i have to put in the 8. line above? ("WHAT HERE???") This mustn't be a fixed string, it must be loadable from the .xml file. How do i encode the link in the XML file? :confused: -Dominik

    C 1 Reply Last reply
    0
    • D Dominik Reichl

      Hello, this is a very basic problem, i think. How can I define an url in the XML file and format/output it with a XSL file? This is my XML file: Download 1 DWL1 link Download 2 DWL2 link2 This is my XSL file:

      Archive

      Downloads

      Name

      Webcode

      Goto

      []( WHAT HERE??? )

      What do i have to put in the 8. line above? ("WHAT HERE???") This mustn't be a fixed string, it must be loadable from the .xml file. How do i encode the link in the XML file? :confused: -Dominik

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      you need to use xsl:attribute to create the href= part of the anchor tag. Something like: That's off the top of my head, but it's basically correct. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

      P 1 Reply Last reply
      0
      • C Christian Graus

        you need to use xsl:attribute to create the href= part of the anchor tag. Something like: That's off the top of my head, but it's basically correct. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

        P Offline
        P Offline
        Philip Fitzsimons
        wrote on last edited by
        #3

        or the short version: <a href="{link}"><xsl:value-of select='link'/></a> notice the use of the curly brakets to shortcut any xpath expression....


        "When the only tool you have is a hammer, a sore thumb you will have."

        C 1 Reply Last reply
        0
        • P Philip Fitzsimons

          or the short version: <a href="{link}"><xsl:value-of select='link'/></a> notice the use of the curly brakets to shortcut any xpath expression....


          "When the only tool you have is a hammer, a sore thumb you will have."

          C Offline
          C Offline
          Christian Graus
          wrote on last edited by
          #4

          That looks great - how does it work ? It's pulling a node called 'link' out of the current context node, and the curly brackets mean that it's put into there, or the curly brackets pull it out of the current context node seperately ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

          P 1 Reply Last reply
          0
          • C Christian Graus

            That looks great - how does it work ? It's pulling a node called 'link' out of the current context node, and the curly brackets mean that it's put into there, or the curly brackets pull it out of the current context node seperately ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

            P Offline
            P Offline
            Philip Fitzsimons
            wrote on last edited by
            #5

            curly brackets are shorthand - they tell the xsl processor to replace the contents with the result of the xpath xpresions xml: <company logo="bob.gif"/> xlst: <xsl:apply-template match="company"> <img src="{@logo}"/> </xsl:apply-template> hope this makes sense - saves alot of typing :) [edit]note that is always in the context of the current node - so equal to current()/@logo [/edit]


            "When the only tool you have is a hammer, a sore thumb you will have."

            C P 2 Replies Last reply
            0
            • P Philip Fitzsimons

              curly brackets are shorthand - they tell the xsl processor to replace the contents with the result of the xpath xpresions xml: <company logo="bob.gif"/> xlst: <xsl:apply-template match="company"> <img src="{@logo}"/> </xsl:apply-template> hope this makes sense - saves alot of typing :) [edit]note that is always in the context of the current node - so equal to current()/@logo [/edit]


              "When the only tool you have is a hammer, a sore thumb you will have."

              C Offline
              C Offline
              Christian Graus
              wrote on last edited by
              #6

              Cool - yes, thanks. I did not know you could do that, and I will find it very useful. Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002 Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002 During last 10 years, with invention of VB and similar programming environments, every ill-educated moron became able to develop software. - Alex E. - 12-Sept-2002

              1 Reply Last reply
              0
              • P Philip Fitzsimons

                curly brackets are shorthand - they tell the xsl processor to replace the contents with the result of the xpath xpresions xml: <company logo="bob.gif"/> xlst: <xsl:apply-template match="company"> <img src="{@logo}"/> </xsl:apply-template> hope this makes sense - saves alot of typing :) [edit]note that is always in the context of the current node - so equal to current()/@logo [/edit]


                "When the only tool you have is a hammer, a sore thumb you will have."

                P Offline
                P Offline
                Paul Watson
                wrote on last edited by
                #7

                Philip Fitzsimons wrote: curly brackets are shorthand - they tell the xsl processor to replace the contents with the result of the xpath xpresions Wow, thanks for the awesome tip. Never seen this mentioned in any XSL tutorial before, is it part of the standard?

                Paul Watson
                Bluegrass
                Cape Town, South Africa

                Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson

                P 1 Reply Last reply
                0
                • P Paul Watson

                  Philip Fitzsimons wrote: curly brackets are shorthand - they tell the xsl processor to replace the contents with the result of the xpath xpresions Wow, thanks for the awesome tip. Never seen this mentioned in any XSL tutorial before, is it part of the standard?

                  Paul Watson
                  Bluegrass
                  Cape Town, South Africa

                  Ray Cassick wrote: Well I am not female, not gay and I am not Paul Watson

                  P Offline
                  P Offline
                  Philip Fitzsimons
                  wrote on last edited by
                  #8

                  yes its part of the standard - comes under 7.6.2 Attribute Value Templates http://www.w3.org/TR/1999/REC-xslt-19991116#dt-attribute-value-template[^]


                  "When the only tool you have is a hammer, a sore thumb you will have."

                  1 Reply Last reply
                  0
                  Reply
                  • Reply as topic
                  Log in to reply
                  • Oldest to Newest
                  • Newest to Oldest
                  • Most Votes


                  • Login

                  • Don't have an account? Register

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • World
                  • Users
                  • Groups