[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: XHTML table of contents with XSLT
as has been said, you can use {generate-id()} rather than {.} to generate ids. Also don't do <xsl:template match="/*[local-name()='html']"> etc, instead add xmlns:h="http://www.w3.org/1999/xhtml" to your xsl:stylesheet, then you can write that as <xsl:template match="/h:html"> and similarly replace <xsl:apply-templates select="*[local-name()='body']"/> by <xsl:apply-templates select="h:body"/> etc. <!-- A default rule will just copy all the rest --> <xsl:template match="*"> <xsl:element name="{name(.)}"> <xsl:for-each select="@*"> <xsl:attribute name="{name(.)}"> <xsl:value-of select="."/> </xsl:attribute> </xsl:for-each> <xsl:apply-templates/> </xsl:element> </xsl:template> can be <!-- A default rule will just copy all the rest --> <xsl:template match="*"> <xsl:copy> <xsl:copy-of select="@*"/> <xsl:apply-templates/> </xsl:copy> </xsl:template> David
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|