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

RE: Clarify Add an element to the result xml document

Subject: RE: Clarify Add an element to the result xml document
From: LVanvleet@xxxxxxxxxx
Date: Tue, 8 Oct 2002 08:55:46 -0500
xml ordernumber
To clarify what I need.
This is source XML:

<Order>
	<OrderHeader>
		<OrderNumber>
			<BuyerOrderNumber>3</BuyerOrderNumber>
			<SellerOrderNumber/>
			<ListOfMessageID>
		<!-- one MessageID element -->
				<MessageID>
					<IDNumber/>
					<IDAssignedBy>
						<IDAssignedByCoded/>
						<IDAssignedByCodedOther/>
					</IDAssignedBy>
					<IDAssignedDate/>
				</MessageID>
			</ListOfMessageID>
		</OrderNumber>

This is what I need the result to look like:

<Order>
	<OrderHeader>
		<OrderNumber>
			<BuyerOrderNumber>3</BuyerOrderNumber>
			<SellerOrderNumber/>
			<ListOfMessageID>
		<!-- nested MessageID elements -->
				<MessageID>
				<MessageID>
					<IDNumber/>
					<IDAssignedBy>
						<IDAssignedByCoded/>
						<IDAssignedByCodedOther/>
					</IDAssignedBy>
					<IDAssignedDate/>
				</MessageID>
				</MessageID>
			</ListOfMessageID>
		</OrderNumber>


The Solution from Michael Kay that follows duplicated the MessageID and
children:
<xsl:template match="MessageID">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
<!-- and again... -->
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

The Solutions from Joerg adds a <MessageID/> element in place of the child
elements:
<xsl:template match="MessageID">
    <xsl:copy>
      <xsl:copy>
      </xsl:copy>
    </xsl:copy>
</xsl:template>

The burning question is why do I want this.  We receive E-Procurement orders
in xCBL, cXML, etc.  We set up mapping in NetFish to our order response and
back-end.  When we start a new element map in NetFish (now Iona E2A
Integrator) we repeat element tags to show repeating groups of elements.

Thanks again for your help - I have tried so many ways to solve this without
manually adding the tags.
Lynda

Lynda Van Vleet
E-Procurement Technical Specialist

Newark Electronics
4801 North Ravenswood Avenue
Chicago IL 60640-4496
773 907 5919
LVanVleet@xxxxxxxxxx

 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.