utahman3431
06-21-2008, 04:45 AM
I am still working on an xml site that is starting to incorporate XSL to transform the XML to HTML. The new question I have is if I can use Javascript to transform just one template in the XSL document as opposed to the whole document?
For example, I have the following XSL doc:
<xsl:template match="chs_document">
<ul id="subnav">
<xsl:apply-templates select="support_doc">
<xsl:sort select="header"/>
</xsl:apply-templates>
</ul>
</xsl:template>
<xsl:template match="support_doc">
<li>
<a>
<xsl:attribute name="href">
javascript://
</xsl:attribute>
<xsl:attribute name="onclick">
show(
<xsl:number />
)
</xsl:attribute>
<xsl:value-of select="header" /> <xsl:number />
</a>
</li>
</xsl:template>
Would it be possible to use some form of javascript code to transform just the second template? I am able to get the full thing to look correct, but I want to add an additional template to the bottom for a different section of the page.
Any help would be appreciated!:thumbsup:
For example, I have the following XSL doc:
<xsl:template match="chs_document">
<ul id="subnav">
<xsl:apply-templates select="support_doc">
<xsl:sort select="header"/>
</xsl:apply-templates>
</ul>
</xsl:template>
<xsl:template match="support_doc">
<li>
<a>
<xsl:attribute name="href">
javascript://
</xsl:attribute>
<xsl:attribute name="onclick">
show(
<xsl:number />
)
</xsl:attribute>
<xsl:value-of select="header" /> <xsl:number />
</a>
</li>
</xsl:template>
Would it be possible to use some form of javascript code to transform just the second template? I am able to get the full thing to look correct, but I want to add an additional template to the bottom for a different section of the page.
Any help would be appreciated!:thumbsup: