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

How would you add depth to this flat XML source?

Subject: How would you add depth to this flat XML source?
From: "Eric G. Bosch" <eric@xxxxxxxxxxx>
Date: Thu, 25 May 2000 14:39:51 -0400 (EDT)
flat eric
I am trying to convert a flat XML document with this structure:

<firstitem>Item 1</firstitem>
<item>Second Text</item>
<item>blah blah</item>
<item>tee hee</item>
<firstitem>List 2, Item 1</firstitem>
<item>more text</item>
<firstitem>more lists</firstitem>
<item>test</item>

into something like this (indenting is purely decorative):

<list>
	<item>Item 1</item>
	<item>Second Text</item>
	<item>blah blah</item>
	<item>tee hee</item>
</list>
<list>
	<item>List 2, Item 1</item>
	<item>more text</item>
</list>
<list>
	<item>more lists</item>
	<item>test</item>
</list>

It seems to me that I can process each <firstitem> element and then apply 
templates to all of the following-siblings that have their first <firstitem> 
preceding-sibling equal to the current <firstitem>.  But, a) I can't seem to get 
the syntax right for this solution, b) this seems like an odd way to solve the 
problem, and c) somebody probably knows an easier way.

Thanks in advance for any suggestions... 

----------
Eric Bosch
Clinical DataFax Systems Inc.
Voice: 905.522.3282.x223
Fax:   905.522.7284
Email: eric@xxxxxxxxxxx


 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.