[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Adding structure to a docment based on attributes

Subject: Adding structure to a docment based on attributes
From: "Nicholas Waltham" <info@xxxxxxxxxxxx>
Date: Mon, 24 Sep 2001 13:49:01 +0200
 Adding structure to a docment based on attributes
Adding sections/subjections and levels depending on formatting type
information

I have an XML document which contains formatting type information like this
(actually this is a bit simplified)


<p style="Heading1">Top Level Heading</p>
<p stlye=Body>Some text at this level</p>
<p style="Heading2">Sub Heading 1</p>
<p stlye=Body>Some text here</p>
<p style="Heading2">Sub heading 2</p>
<p stlye=Body>Some text here</p>
<p style="Heading1">Another Heading</p>
<p stlye=Body>Some more text here</p>


I would like to add some logical structure to the document, to have
something like this
<MAIN><HEADING>Top Level Heading</HEADING><TEXT>Some text at this
level</TEXT>
<SUBSECTION><HEADING>Sub Heading 1<TEXT>Some text here</TEXT></SUBSECTION>
<SUBSECTION><HEADING>Sub Heading 2<TEXT>Some text here</TEXT></SUBSECTION>
<HEADING>Top Level Heading</HEADING><TEXT>Some more text here</TEXT>
</MAIN>


Can I do this with XSLT, some pointers would be great.

I know for example I can match the different styles with a template

match="p[@style='Heading1']"

but the problem is closing the logical structure at the right place.

Hope you can help,
Regards,
Nicholas Waltham




 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.