Forum Moderators: open
Does anyone see what I am doing wrong?
Here's the xsl.
____________________
<p>
<xsl:for-each select="Page">
<choose>
<when>
<a href="@URL"><value-of select="@Link" /></a>
</when>
<otherwise>
<a href="@URL"><value-of select="@NavName" /></a>
</otherwise>
</choose>
</xsl:for-each>
</p>
Here's the xml
________________
<Page Name="LinkList" Link="Test" URL="http://www.google.com" />
<Page ID="x1092" Name="LinkList" Link="People & Communities" URL="x1092.xml?Preview=true&Site=&UserAgent=&IncludeAllPages=true&tfrm=4" Title="People & Communities" Abstract="People & Communities" NavName="People & Communities" CreationDate="20090513T14:32:00" Changed="20090513T18:33:10" CategoryIds="" Schema="SectionFront" />
<xsl:choose>
<xsl:when>
2) invalid XSLT syntax:
<a href="@URL">
should be
<a>
<xsl:attribute name="href" value="@URL"/>
<value-of select="@NavName" />
</a>
3) <xsl:choose> and <xsl:when> requires a conditional statement (it's analogous to an "if" statement...
W3Schools has some wicked tutorials on XSLT.
[w3schools.com...]
Take a moment to peruse the Terms of Service [webmasterworld.com], then introduce yourself [webmasterworld.com] to the community.