Linking with xml content

Discussion in 'XML' started by Sneamia, Jun 2, 2006.

  1. Sneamia

    Sneamia Guest

    Hi, im a noob at xml and stuff.
    I have an xml document, and I styled it with an xsl file.
    I want to use content in the xml file to use as a link, like, for
    example, in the xml file is this:

    <link>http://www.link.com</link>
    <description>A link</description>

    I want to use something like:

    <xsl:for-each select="file/content">
    <td><xsl:value-of select="description"/></td>
    </xsl:for-each>

    Is there any simple way for me to use the data for the link in the xml
    file to link the description?
    like <a href="<xsl:value-of select="link"/>"><xsl:value-of
    select="description"/></a>, but it doesnt work because I cant have a
    tag in a tag...is there something I'm missing?
     
    Sneamia, Jun 2, 2006
    #1
    1. Advertising

  2. > like <a href="<xsl:value-of select="link"/>"><xsl:value-of
    > select="description"/></a>, but it doesnt work because I cant have a
    > tag in a tag...is there something I'm missing?


    1) Attribute Value Templates
    <a href="{link}"><xsl:value-of select="description"/></a>

    2) xsl:attribute
    <a>
    <xsl:attribute name="href">
    <xsl:value-of select="link"/>
    </xsl:attribute>
    <xsl:value-of select="description"/>
    </a>
     
    Joe Kesselman, Jun 2, 2006
    #2
    1. Advertising

  3. Sneamia

    Sneamia Guest

    Thanks.
     
    Sneamia, Jun 3, 2006
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Janaka

    Content Linking

    Janaka, Apr 29, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    377
    Janaka
    Apr 29, 2004
  2. hazz
    Replies:
    6
    Views:
    49,637
    SkyUCHC
    Jun 9, 2010
  3. Stanimir Stamenkov
    Replies:
    2
    Views:
    749
    Stanimir Stamenkov
    Oct 25, 2005
  4. Sanjeev
    Replies:
    4
    Views:
    1,450
    Stanimir Stamenkov
    May 4, 2008
  5. Erik Wasser
    Replies:
    5
    Views:
    465
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page