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

Re: First Element Event

Subject: Re: First Element Event
From: "Joris Gillis" <roac@xxxxxxxxxx>
Date: Thu, 08 Sep 2005 09:09:34 +0200
joris pape
Hi,
Tempore 01:12:17, die 09/08/2005 AD, hinc in xsl-list@xxxxxxxxxxxxxxxxxxxxxx scripsit Pape, Nathan S. <Nathan.Pape@xxxxxxx>:


Basically my source document contains a group of two or more aliases, as in the element named: <OTHER_NAME> , and I just need to move them to the result tree under only one element

Try the following templates:


<xsl:template match="/">
	<xsl:element name="abcxyz:transaction">
		<xsl:element name="abcxyz:record">
			<xsl:attribute name="type"><xsl:value-of select="2"/></xsl:attribute>
			<xsl:apply-templates/>
		</xsl:element>
	</xsl:element>
</xsl:template>

<xsl:template name="process_record" match="OTHER_NAME[1]">
	<xsl:element name="abcxyz:field">
		<xsl:attribute name="name">
			<xsl:value-of select="'T2_AKA'"/>
		</xsl:attribute>
		<xsl:attribute name="number">
			<xsl:value-of select="19"/>
		</xsl:attribute>
		<xsl:apply-templates select="../OTHER_NAME" mode="group_aliases"/>
	</xsl:element>
</xsl:template>

<xsl:template match="OTHER_NAME[position()!=1]"/>

<xsl:template match="OTHER_NAME/*" mode="group_aliases">
	<xsl:element name="abcxyz:subfield">
		<xsl:element name="abcxyz:item">
			<xsl:value-of select="."/>
		</xsl:element>
	</xsl:element>
</xsl:template>

regards,
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Deserta faciunt et innovationem appelant

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.