|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: XML Group with XSL
> -----Original Message----- > From: aalikaj@xxxxxxxxxxxx [mailto:aalikaj@xxxxxxxxxxxx] > > I'm still trying to solve my problem. > > In a few words, i'm trying to explain my problem again. > > I have an XML file with this format: > Hi, That sample looks a lot easier to handle than the one you posted yesterday. Try this: <xsl:stylesheet ...> <xsl:key name="n-id-key" match="*[@ID]" use="concat(count(ancestor::*),' ',name(),' ',@ID)" /> <xsl:template match="/"> <xsl:apply-templates /> </xsl:template> <xsl:template match="ROOT"> <xsl:copy> <xsl:apply-templates select="*[generate-id()=generate-id( key('n-id-key',concat( '1 ', name(),' ',@ID)))]" /> </xsl:copy> </xsl:template> <xsl:template match="*"> <xsl:variable name="vcount" select="count(ancestor::*)+1" /> <xsl:copy> <xsl:copy-of select="@*" /> <xsl:copy-of select="normalize-space(text())" /> <xsl:apply-templates select="../*[name()=name(current()) and @ID=current()/@ID]/*[ generate-id()=generate-id( key('n-id-key',concat( $vcount,' ',name(),' ',@ID)))]" /> </xsl:copy> </xsl:template> Seems to be leading to the wanted result... Hope this helps! Cheers, Andreas
|
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








