|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Problem with generating references.
Tempore 14:57:07, die 07/05/2005 AD, hinc in
xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Lakshmi narayana
<lchintala@xxxxxxxxxxxx>:
for each element so that I can identify each element uniquely). This stylesheet generates the ouput from your sample. It will need some adaption though, to work in a real situation. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <xsl:output method="xml" indent="yes"/> <xsl:key name="element" match="*" use="substring(local-name(),1,1)"/> <xsl:template match="/"> <xsl:for-each select="//*[generate-id()=generate-id(key('element',substring(local-name(),1,1)))]"> <xsl:element name="{substring(local-name(),1,1)}-group"> <xsl:for-each select="key('element',substring(local-name(),1,1))"> <xsl:copy> <xsl:for-each select="*"> <reference><xsl:attribute name="id"><xsl:number count="*" level="any"/></xsl:attribute></reference> </xsl:for-each> </xsl:copy> </xsl:for-each> </xsl:element> </xsl:for-each> </xsl:template> </xsl:stylesheet>
|
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
|

Cart








