[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] reversing or swapping nested node hierarchy
Hi all. In an XML document: <root> <a> <b /> </a> <a /> </root> Is it possible to reverse the a/b hierarchy to produce b/a on output? To complicate the problem, not all <a>'s have <b>'s. So, in solving the problem, I've come up with something like this: <template name="a" match="a"> <a /> </template> <template match="a[b]"> <b> <call-template name="a" /> </b> </template> ..which works, but the <b> template now has working knowledge of <a>. I'd like to find a generic solution where <b> doesn't have to know about <a> so that <b> can be nested inside other elements too and yet work the same way. Thanks, Chris.
|
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
|