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

Attribute Names of the longest branch (Creating CSV data)

Subject: Attribute Names of the longest branch (Creating CSV data)
From: "Steve Brown" <prospect@xxxxxxxxxxx>
Date: Fri, 7 Apr 2000 16:58:33 +1000
csv branch
Hi,

I am currently trying to convert tiered Xml into a CSV file.  The number of
elements/attributes and depth of the data is not known at runtime.

I can get the comma seperated data appearing fairly well currently but am
having trouble getting the column names.

eg for the data

<books>
	<book bookname="blinky bill"/>
	<book bookname="superman">
		<author name="steve" age="24"/>
	</book>
	<book bookname="snugglepot">
		<author name="frank" age="60"/>
	</book>
</books>

I want to get the output:

bookname,name,age
blinky bill
superman,steve,24
snugglepot,frank,60

I am getting the data ok, but the header line is tougher as you need to know
the longest "branch" in the data to get all of the possible column names.

Any ideas?  (remember that I will not know the shape, depth , attribute or
element names at runtime)

Thanks,

Steve


 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.