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

RE: Can you break one node tree into two?

Subject: RE: Can you break one node tree into two?
From: "Wilde Rebecca L SSgt HQ SSG/STS" <Rebecca.Wilde@xxxxxxxxxxxxx>
Date: Tue, 1 Feb 2005 10:52:20 -0600
xsl template break
Thank you for all the responses!  Working with those I was able to come
up with and was able to get to work:

<xsl:template match="RootEle">
	<xsl:if test="*/Address">
		<xsl:copy>
			<xsl:apply-templates mode="Addressing"/>
		</xsl:copy>
	</xsl:if>
	<xsl:copy>
		<xsl:apply-templates mode="Message"/>
	</xsl:copy>
</xsl:template>

<xsl:template match="RootEle/*" mode="Addressing">
	<xsl:variable name="a" select="Address"/>
	<xsl:copy>
		<xsl:copy-of select="$a | $a/preceding-sibling::*"/>
	</xsl:copy>
</xsl:template>

<xsl:template match="RootEle/*" mode="Message">
	<xsl:variable name="b" select="Address"/>
	<xsl:choose>
		<xsl:when test="$b">
			<xsl:copy>
				<xsl:copy-of
select="$b/following-sibling::*"/>
			</xsl:copy>
		</xsl:when>
		<xsl:otherwise><xsl:copy-of select="."/></xsl:otherwise>
	</xsl:choose>
</xsl:template>

This will take into account if I did not get an "Address" node as well
as not force me to know what any node is besides the "RootEle" and
"Address".

Thank you all for the help.  Now I just have to see how well I can
continue to tweak.

Becky

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.