[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?
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|