SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    noob XSL question.

    I am styling an XML document for viewing in an HTML page, and have the following code to show an element's value:

    <xsl:value-of select="package"/>

    But what i really want is something like

    <a href="distro/<xsl:value-of select="package"/>.zip">clicky</a>

    Is this sort of thing available through XSL styling at all?

  2. #2
    SitePoint Wizard HarryR's Avatar
    Join Date
    Dec 2004
    Location
    London, UK
    Posts
    1,376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hi,
    I'm just working off the top of my head here without (the lovely and amazing) Oxygen XML editor to test it in.. but you could try something as follows:

    Code:
    <xsl:element name="a">
      <xsl:attribute name="href">distro/<xsl:value-of select="package"/>.zip</xsl:attribute>
      clicky
    </xsl:element>
    I'm sure there's some sort of nice short way you can do it though I just can't remember.

    Cheers,
    - Harry

  3. #3
    SitePoint Wizard xyuri's Avatar
    Join Date
    Jul 2002
    Location
    Brisbane
    Posts
    1,487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That worked great Thank you very much.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •