[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Converting siblings into children
I have a number of html files that I converted to xml using python. Problem is that all the <p> tags are siblings. Given this: <?xml version="1.0"?> <html> <body> <p><a name="one"><b>1.1.1</b></a></p> <p>1.1.1.1 </p> <p>1.1.1.2 </p> <p>1.1.1.3 </p> <p>1.1.1.4 </p> <p><a name="two"><b>1.1.2</b></a></p> <p>1.1.2.1 </p> <p>1.1.2.2 </p> <p>1.1.2.3 </p> <p>1.1.2.4 </p> <p>1.1.2.5 </p> <p>1.1.2.6 </p> <p>1.1.2.7 </p> <p>1.1.2.8 </p> <p><a name="three"><b>1.1.3</b></a></p> <p>1.1.3.1 </p> <p>1.1.3.2 </p> <p>1.1.3.3 </p> <p>1.1.3.4 </p> <p>1.1.3.5 </p> <p>1.1.3.6 </p> </body> </html> I need an output like this: <p> <a name="one"><b>1.1.1</b></a> <p>1.1.1.1 </p> <p>1.1.1.2 </p> <p>1.1.1.3 </p> <p>1.1.1.4 </p> </p> <p> <a name="two"><b>1.1.2</b></a> <p>1.1.2.1 </p> <p>1.1.2.2 </p> <p>1.1.2.3 </p> <p>1.1.2.4 </p> <p>1.1.2.5 </p> <p>1.1.2.6 </p> <p>1.1.2.7 </p> <p>1.1.2.8 </p> </p> <p> <a name="three"><b>1.1.3</b></a> <p>1.1.3.1 </p> <p>1.1.3.2 </p> <p>1.1.3.3 </p> <p>1.1.3.4 </p> <p>1.1.3.5 </p> <p>1.1.3.6 </p> </p> Any ideas? Thanks in advance.
|
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
|