[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] impossible to implement this algorithm in xslt?
I'm beginning to despair in the possibility that it may be impossible to implement this algorithm in xslt. Perhaps one of you battle-hardened vets could shed some light... Input doc: <doc> <sect depth="3">heading</sect> <A level="1"> <B level="2">xx</B> </A> <sect depth="7">heading2</sect> <C level="1"> <D level="2">yy</D> </C> </doc> Desired output: <doc> <sect depth="3">heading</sect> <A level="4"> <B level="5">xx</B> </A> <sect depth="7">heading2</sect> <C level="8"> <D level="9">yy</D> </C> </doc> Note how the 'level' attributes in the output represent the sum of their value in the input and the value of the 'depth' attribute of the <sect> which precedes it. Given the recursive processing paradigm of xslt, without the ability for a template to return a value or to set a global variable, I can't figure out how I can process the <sect>s and make the value of their 'depth' attributes available for the processing of the other elements. Would someone please tell me I'm missing something?!? Thanks very much
|
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
|