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

Problem generating default attribute values.

Subject: Problem generating default attribute values.
From: "Jonathan Jenkins" <jon.jenkins@xxxxxxxxxxxxxxxxx>
Date: Fri, 15 Nov 2002 11:33:21 -0000
jonathan jenkins
I couldn't find anything specific to my problem in the FAQ - although 
it is related to flattening..

I have the following XML input.

<transaction-list>
	<transaction total="T1" >
	   <breakdown account="B" amount="Y" />
	   <breakdown account="D" amount="Z" />
	   <breakdown account="A" amount="X" />
         <!-- no two breakdown children have -->
         <!-- the same account attribute value --> 
	</transaction>
	
	<transaction total="T2" >
	   <breakdown account="B" amount="P" />
	   <breakdown account="A" amount="R" />
	   <breakdown account="C" amount="Q" />
         <!-- no two breakdown children have -->
         <!-- the same account attribute value --> 
	</transaction>
</transaction-list>

I would like to generate this.

<dest-transaction-list total="total" A="A" B="B" C="C" D="D">
	<dest-transaction   total="T1" A="X" B="Y" C="0" D="Z"/>
	<dest-transaction   total="T2" A="R" B="P" C="Q" D="0"/>
</dest-transaction-list>

Each transaction should map to a dest-transaction element, which
is a straightforward transformation, apart from one thing.

Each dest-transaction needs to have an attribute value for every account
attribute value. If the particular account attribute value does
not exist as a child of the corresponding transaction/breakdown 
element, then it should output a zero '0'.

I hope the XML is clearer than my explanation or the subject title..

-Jon


 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.