|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] transform from flat to hierarchical
Hi all, I need to transform from flat and somewhat unstructured XML to a more structual form. Here is a sample: <logs> <log>a</log> <log>sub b</log> <log>c</log> <log>sub d</log> <log>e</log> <log>f</log> <log>end of d</log> <log>g</log> <log>end of b</log> <log>h</log> <log>i</log> <logs> into a more structured content with nesting: <logs> <log name="a"> <log name="b"> <log name="c"> <log name="d"> <log name="e"/> <log name="f"/> </log> </log> <log name="g"/> </log> </log> <log name="h"/> <log name="i"/> </logs> Is this doable by using XSLT/XPATH?. If yes, please include some sample XSLT code. I've looked at some examples of "flat to hierarchical" transformations but they are dealt with nestings that are determined by a single node (i.e. with a "level" attribute) instead of begin-end node pair (as in the "sub <node>", "end of <node>" pair from above). Thanks, kkt
|
Back To School Sale!Save 30% off all Stylus Studio 2008 Products when you purchase from our Online Shop. 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
|






