|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
flat xml file to hierarchical using xsl
I currently have something like the following xml file;
<document> <textheading level="1">heading text</textheading> <textheading level="2">heading text</textheading> <textparagraph>text</textparagraph> <textheading level="3">heading text</textheading> <textparagraph>text</textparagraph> <textheading level="3">heading text</textheading> <textparagraph>text</textparagraph> <textheading level="2">heading text</textheading> <textparagraph>text</textparagraph> <textheading level="3">heading text</textheading> <textparagraph>text</textparagraph> </document> I want to nest these and create the following using an xsl file; <document> </documenttitle>heading text</documenttitle> <textheading1> <heading>heading text</heading> <textheading2> <heading>heading text</heading> <textparagraph>text</textparagraph> <textheading3> <heading>heading text</heading> <textparagraph>text</textparagraph> <textparagraph>text</textparagraph> </textheading3> <textheading3> <heading>heading text</heading> <textparagraph>text</textparagraph> <textparagraph>text</textparagraph> </textheading3> </textheading2> <textheading2> <heading>heading text</heading> <textparagraph>text</textparagraph> <textheading3> <heading>heading text</heading> <textparagraph>text</textparagraph> <textparagraph>text</textparagraph> </textheading3> </textheading2> </textheading1> </document> Is there anyone out there who can point me to an existing xslt stylesheet that does this? Just to give a little more background, I am using the openoffice.org writer word processor and want to convert the content xml file(the first above xml file format) into another xml file format (the second of the above formats). thanks in advance for any help |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > flat xml file to hierarchical using xsl |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|