[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Conditional Merging of the node based child valu
Senthilkumaravelan Krishnanatham wrote:
Hi Senthil, I don't see such a thing as a line item number in your code, but it appears to me you are actually talking about ITEM_NUMBER that must equal, and you want to group the CTO_INFO elements inside the CTOS section, when these ITEM_NUMBER match. Something like that. If that's so, here's a stylesheet that (almost) produces that output you have. You probably want to tweak it a bit. For instance, it currently outputs an empty CTOS element when there are no matchin ITEM_NUMBER nodes. Have fun with it, Cheers, Abel Braaksma http://abelleba.metacarpus.com <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" /> <xsl:template match="/"> <ORDER> <xsl:apply-templates select="ORDER/TAB_ITEM" /> </ORDER> </xsl:template> <xsl:template match="TAB_ITEM"> <xsl:variable name="nr" select="ITEM_NUMBER" /> <TAB_ITEM> <xsl:copy-of select="*" /> <CTOS> <xsl:apply-templates select="../TAB_CTO[ITEM_NUMBER = $nr]/CTO_INFO" /> </CTOS> </TAB_ITEM> </xsl:template> <xsl:template match="CTO_INFO"> <xsl:copy-of select="." /> </xsl:template> </xsl:stylesheet>
|
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
|