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

Element - centric output

Subject: Element - centric output
From: Maulik Modi <MModi@xxxxxxxxxx>
Date: Wed, 2 Jan 2002 17:48:35 -0600
element centric

I have the following xml document and want element centric output. The input
document is:

<input "bunch of ns declarations...">
	<s:AttributeType name="CustomerID" />
	<s:AttributeType name="CompanyName"/>
	<s:AttributeType name="ContactName"/>
	<s:AttributeType name="ContactTitle"/>
	<z:row CustomerID="ALFKI" ContactName="Maria Anders"
ContactTitle="Sales Representative" />
	<z:row CustomerID="ANATR" CompanyName="Ana Trujillo Emparedados y
helados" ContactName="Ana Trujillo" ContactTitle="Owner" />

I want to output an element-centric XML from it. I also want to create leaf
elements in the output if the attribute does not exist in the data/row but
does exist as a required name in AttributeType/@name. For example, in the
above XML, I would like the leaf element created for CompanyName for the
first row. How can I acheive this? I already have the attribute to element
translation working. I only need help for generating the leaf element if the
attribute does not exist in the data set. 

Expected output:
		<ContactName>Maria Anders</ContactName>
		<ContactTitle>Sales Representative</ContactTitle>
		<CompanyName>Ana Trujillo Emparedados y
		<ContactName>Ana Trujillo</ContactName>

Thanks in advance for your help.


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

Current Thread


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.
First Name
Last Name
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.