Subject: Re: [xsl] Stylesheet to output XML Tags (node names) From: "António Mota" <amsmota@xxxxxxxxx> Date: Thu, 20 Apr 2006 20:29:52 +0100 |
I changed the stylesheet to output also attributes, and changed a few things: <?xml version='1.0' encoding='ISO-8859-1'?> <xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:key name="nodenames" match="*" use="name()" /> <xsl:template match="/"> <nodes> <xsl:apply-templates select="*[count(. | key('nodenames', name())[1]) = 1]"/> </nodes> </xsl:template> <xsl:template match="*"> <node> <xsl:attribute name="name"> <xsl:value-of select="name()" /> </xsl:attribute> <xsl:apply-templates select="@*"/> </node> <xsl:apply-templates select="*[count(. | key('nodenames', name())[1]) = 1]"/> </xsl:template> <xsl:template match="@*"> <attr> <xsl:attribute name="name"> <xsl:value-of select="name()" /> </xsl:attribute> </attr> </xsl:template> </xsl:transform>
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Stylesheet to output XML , António Mota | Thread | [xsl] Help Needed On Re-Organizing , Charles Gillanders |
RE: [xsl] Character 150 withs Windo, XSLList | Date | Re: [xsl] Character 150 withs Windo, andrew welch |
Month |