|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] following-sibling::
First time poster in need of assistance =)
Using XSLT 1.0, given the following structure: <document> <aaa /> <aaa /> <aaa /> <aaa /> <aaa stylename='start' /> <aaa /> <aaa /> <aaa /> <aaa /> <aaa stylename='finish' /> <aaa /> <aaa /> <aaa /> <aaa /> <aaa /> <aaa stylename='start' /> <aaa /> <aaa /> <aaa stylename='finish' /> <aaa /> <aaa /> </document> How can I make the <aaa /> elements that exist in between @='start' and @='finish become children of <aaa stylename='start' />? I've tried some sibling recursion techniques and such but I can't get my XPath right. I can select all the following-siblings of @='start' until the end of the document, but I need to select all of the following-siblings of @='start' until I reach @='finish'. I've been using <xsl:copy-of select="following- sibling::*[@stylename='finish']" /> but this selection isn't stopping when I reach the first 'finish'. It's just selecting all the 'finish' in the document. Desired output: <document> <aaa /> <aaa /> <aaa /> <aaa /> <aaa stylename='start'> <aaa /> <aaa /> <aaa /> <aaa /> </aaa> <aaa /> <aaa /> <aaa /> <aaa /> <aaa /> <aaa stylename='start' /> <aaa /> <aaa /> </aaa> <aaa /> <aaa /> </document> In addition to this selection issue, "copy-of" is simply copying the elements to the result tree without applying templates. How can I 'copy' these elements and then apply-templates?
|
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
|






