[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: axis specifier issue
a kusa wrote:
What I want is that any <note> element that is below <desc> and before<prt2> to be pushed under <prt2>. With XSLT 2.0 you can achieve that as follows: <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"> <xsl:template match="@* | node()"> <xsl:copy> <xsl:apply-templates select="@*, node()"/> </xsl:copy> </xsl:template> <xsl:template match="prt1"> <xsl:copy> <xsl:apply-templates select="@*, node() except note[. >> current()/desc[1] and . << current()/prt2[1]]"/> </xsl:copy> </xsl:template> <xsl:template match="prt2"> <xsl:copy> <xsl:apply-templates select="@*, preceding-sibling::note[. >> current()/preceding-sibling::desc[1]], node()"/> </xsl:copy> </xsl:template> </xsl:stylesheet> -- Martin Honnen http://msmvps.com/blogs/martin_honnen/
|
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
|