hyperlinks in XSLT, please help.
I'm soo frustrated because I can't get this to render properly. I'm new to this so any help would be greatly appreciated. Here is my xml:
<sitename xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="C:\Documents and Settings\mellan\Desktop\X-Excersize\content.xsd">
<bodycopy>
<header>
This is the header
</header>
<paragraph>
This is just another test paragrast another test paragrast another test paragrast another test paragrast another test paragrast <links><link name="Link text" url="http://www.url.com"/></links>
another test asdasdfasdfparagrast another test paragraph
</paragraph>
</bodycopy>
</sitename>
Here is my XSL where I'm trying to get this link to show in the actual paragraph (as structured above):
<xsl:template match="bodycopy">
<h1>
<xsl:value-of select="header"/>
</h1>
<xsl:for-each select="paragraph">
<xsl:for-each select="links/link">
<a>
<xsl:attribute name="href">{@url}</xsl:attribute>
<xsl:value-of select="@url"/><p/>
</a>
</xsl:for-each>
<xsl:value-of select="text()"/>
<p/>
</xsl:for-each>
</xsl:template>
As you can see I tried nesting it but I'm certain this is a horrible way to do this. Can anyhow give me some direction?
Thanks so much,
-m
|