href values and value-of

Dante

Usenet Archive
Joined
Feb 21, 2002
Messages
29
Reaction score
0
Hello. I am creating an xml list of links with structure like the below:

<item>
<title>Bullet Madness</title>
<uri>http://www.stylegala.com/archive/bulletmadness/</uri> <description>200 bullets, each of them nice in their own way</description> </item>

I need to create a link with that data. When I tried to do something like <a href="<xsl:value-of select="uri">">text</a>

I got the error that the structure was not well formed. How else would I create a link with proper structure?

Thanks, Dante
 

Chris Huebsch

Usenet Archive
Joined
Apr 12, 2004
Messages
18
Reaction score
0
Dante (29 Sep 2004 20:46:59 -0700):
<item>
<title>Bullet Madness</title>
<uri>http://www.stylegala.com/archive/bulletmadness/</uri> <description>200 bullets, each of them nice in their own way</description> </item>

I need to create a link with that data. When I tried to do something like <a href="<xsl:value-of select="uri">">text</a>

<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute> text </a>

Chris
 

Malcolm Dew-Jones

Usenet Archive
Joined
Jan 24, 2002
Messages
347
Reaction score
0
Dante wrote:
Hello. I am creating an xml list of links with structure like the below:

<item>
<title>Bullet Madness</title>
<uri>http://www.stylegala.com/archive/bulletmadness/</uri> <description>200 bullets, each of them nice in their own way</description> </item>

I need to create a link with that data. When I tried to do something like <a href="<xsl:value-of select="uri">">text</a>

I got the error that the structure was not well formed. How else would I create a link with proper structure?

Something like

&lt;a href="<xsl:value-of select="uri">"&gt; text &lt;/a&gt;
 

Richard Tobin

Usenet Archive
Joined
Jan 6, 2000
Messages
4,251
Reaction score
0
<a href="<xsl:value-of select="uri">">text</a>
[/QUOTE]
<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute> text </a>

You forgot the attribute name:

<xsl:attribute name="href"><xsl:value-of select="uri"/></xsl:attribute>

There's a shorthand for attribute values:

<a href="{uri}">text</a>

See "attribute-value-templates" in the XSLT spec.

-- Richard
 

Dante

Usenet Archive
Joined
Feb 21, 2002
Messages
29
Reaction score
0
Chris Huebsch said:
<a>
<xsl:attribute><xsl:value-of select="uri"/></xsl:attribute> text </a>

Chris

Wouldn't you have to specify the attribute, by doing
<xsl:attribute="href"><xsl:value-of select="uri"/></xsl:attribute> ?

Dante
 

Chris Huebsch

Usenet Archive
Joined
Apr 12, 2004
Messages
18
Reaction score
0
Dante (30 Sep 2004 08:59:31 -0700):
Wouldn't you have to specify the attribute, by doing
<xsl:attribute="href"><xsl:value-of select="uri"/></xsl:attribute> ?

as others stated already

<xsl:attribute name="href">....

Chris
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
548,208
Messages
3,104,802
Members
249,594
Latest member
henrywalsh

Latest Threads

Top