Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using linking tags? 1

Status
Not open for further replies.

XMLidiot

Programmer
Jan 27, 2001
22
0
0
US
How do I use XSL and make a link that links to the value of something in my XML thing? I want to do something like this:

<a href=&quot;<xml:value-of select=&quot;url&quot;>&quot;><xml:value-of select=&quot;url&quot;></a>

How would I do that? I get an error whenever I try that.
 
Obviously, the problem is in your nested quotes...
Not so obvious is how to fix it...

Maybe something like this:
<a href='<xml:value-of select=&quot;url&quot;>'><xml:value-of select=&quot;url&quot;></a>

Also try:
<a href=&quot;dummy.html&quot;><xml:value-of select=&quot;url&quot;></a>
Just to see if your statement is correct...

Rosalie Dieteman
 
I tried your first one an got an error ssaying that an xsl value cannot be used as an attribute.
 
The best(and only) to do this is make the elements like this :

<xsl:element name=&quot;a&quot;>
<xsl:attribute name=&quot;href&quot;>
<xsl:value-of select=&quot;url&quot;/>
</xsl:attribute>
</xsl:element>

<xsl:element name=&quot;img&quot;>
<xsl:attribute name=&quot;src&quot;>
<xsl:value-of select=&quot;pic.gif&quot;/>
</xsl:attribute>
</xsl:element>

 
This will make the &quot;title&quot; text as a hyperlink to &quot;maindoc&quot;

<xsl:element name=&quot;a&quot;>
<xsl:attribute name=&quot;href&quot;>
<xsl:value-of select=&quot;maindoc&quot;/>
</xsl:attribute>
<xsl:value-of select=&quot;title&quot;/>
</xsl:element>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top