J
JustinCarmony
My employer wants me to explore the possibilities of XSLT for a new
project I am working on. It seems to work great for some things, but
here is an issue:
My boss wants to make a XML based web service, and a XSLT template to
parse that XML into a fully functioning webpage. There is the issue, I
can modify content between HTML tags and such, but lets say the
following example:
-----------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div id="mainNav">
<ul>
<xsl:for-each select="/linkLists/linkList/link">
<li class="home"><a href="#"><span></span><xsl:value-of
select="defaultText" /></a></li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------------------------------------------------------------------------------
I can change the default Text. However, I cannot change values within
the <li> and <a> tags without getting an error. The following does not
work:
<li class="<xsl:value-of select="className" />"><a href="<xsl:value-of
select="linkURL />"><span></span><xsl:value-of select="defaultText"
/></a></li>
Is there a way to accomplish this and parse correctly? Thank you.
project I am working on. It seems to work great for some things, but
here is an issue:
My boss wants to make a XML based web service, and a XSLT template to
parse that XML into a fully functioning webpage. There is the issue, I
can modify content between HTML tags and such, but lets say the
following example:
-----------------------------------------------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<div id="mainNav">
<ul>
<xsl:for-each select="/linkLists/linkList/link">
<li class="home"><a href="#"><span></span><xsl:value-of
select="defaultText" /></a></li>
</xsl:for-each>
</ul>
</div>
</xsl:template>
</xsl:stylesheet>
-----------------------------------------------------------------------------------------------------------------------
I can change the default Text. However, I cannot change values within
the <li> and <a> tags without getting an error. The following does not
work:
<li class="<xsl:value-of select="className" />"><a href="<xsl:value-of
select="linkURL />"><span></span><xsl:value-of select="defaultText"
/></a></li>
Is there a way to accomplish this and parse correctly? Thank you.