Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: [xsl] Can you break one node tree into two?

From: "Wilde Rebecca L SSgt HQ SSG/STS" <Rebecca.Wilde@------------->
To:
Date: 2/1/2005 4:59:00 PM
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


transparent
Print
Mail
Digg
delicious
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent