[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Changing a Tree Walking, forward walk example
Hi everyone,
I am having trouble converting this Tree Walking, forward walk example : http://www.dpawson.co.uk/xsl/sect2/N4486.html#d6060e1105 Into something more related to my problem and I am using XSLT 2.0. The example in mention will convert this: <document> <para>First para</para> <change-start id="c1"/> <para>Second para</para> <para>Third para</para> <change-start id="c2"/> <para>Fourth para</para> <change-end id="c2"/> <para>Fifth para</para> <change-end id="c1"/> <para>Sixth para</para> </document> To this: <document> <para>First para</para> <ins id="c1"> <para>Second para</para> <para>Third para</para> <ins id="c2"> <para>Fourth para</para> </ins> <para>Fifth para</para> </ins> <para>Sixth para</para> </document> The problem is that my list does not have an end list node if a new list starts immediately after an existing list. So for example this: <document> <p>Non List text</p> <list>List Heading Type 1</list> <p>First item</p> <p>Second item</p> <list>List Heading Type 2</list> <p>First item</p> <p>Second item</p> <p>Third item</p> <list>End List</list> <p>Unrelated Text</p> <p>Not in a list</p> <list>List Heading Type 1</list> <p>First item</p> <list>End List</list> <p>More Unrelated Text</p> <p>Not in a list</p> </document> Needs to be changed to this: <document> <p>Non List text</p> <list> <li>First item</li> <li>Second item</li> </list> <list> <li>First item</li> <li>Second item</li> <li>Third item</li> </list> <p>Unrelated Text</p> <p>Not in a list</p> <list> <li>First item</li> <li>Second item</li> </list> <p>More Unrelated Text</p> <p>Not in a list</p> </document> I am finding it hard because I need to match a list node that does not contain "End List" to start a list as well as end it. So far I have not been able to detect if I am still in a list before a new list starts, in which case I need to close it and start a new one. Thanks in advance for any help on this.
|
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
|