XSLTGeneral questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.
You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
So we iterate the nodes and for each <CLO> node we hit we create a <Header> node in the resultant XML, and for each <ORD> node underneath that <CLO> we output a <Detail> for that <Header>.
One problem is we do not know how many <CLO> nodes there will be or how many <ORD> nodes refer to that <CLO> (the subsequent <ORD> nodes always apply to the previous <CLO>).
The big issue is that we need to open a <Header> node if we find a <CLO> but we wont be closing that header node until we have iterated the nodes a few more times to find the next <CLO> this causes the XSL document to not be well formed and so does not work.