468,133 Members | 1,261 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,133 developers. It's quick & easy.

Linking with xml content

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?

Jun 2 '06 #1
2 1020
> 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>
Jun 2 '06 #2
Thanks.

Jun 2 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

7 posts views Thread by George Hernandez | last post: by
1 post views Thread by Mike | last post: by
3 posts views Thread by Headless | last post: by
15 posts views Thread by Rob Ratcliff | last post: by
4 posts views Thread by Gary Hughes | last post: by
reply views Thread by nachitas | last post: by
27 posts views Thread by didacticone | last post: by
1 post views Thread by gcdp | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.