[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Re:Help needed in recursively converting the flat
Hi Wendell,
I have provided the comments to the second issue of Nested Concurrent-block nodes. <?xml version='1.0' encoding='UTF-8'?> <xsl:stylesheet exclude-result-prefixes="fo ms" version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ms="urn:ms-xsl" xmlns:fo="http://www.w3.org/1999/XSL/Format"> <xsl:output method="xml" encoding="UTF-8" indent="yes"/> <xsl:template match="/ |node()"><xsl:copy> <xsl:apply-templates select="@*|node()"/> </xsl:copy></xsl:template> <xsl:template match="@*"> <xsl:copy> </xsl:copy> </xsl:template> <xsl:key name="act-name" match="/processXML/process-definition/activity-state" use="@name"/> <xsl:key name="act-name" match="/processXML/process-definition/decision" use="@name"/> <xsl:key name="jname" match="/processXML/process-definition/join" use="@name"/> <xsl:key name="con-name" match="/processXML/process-definition/concurrent-block" use="fork/@name"/> <xsl:key name="forktransitions" match="/processXML/process-definition/concurrent-block/fork/transition" use="@to"/> <xsl:template match="activity-state[(key('forktransitions',@name))]"/> <xsl:template match="join" /> <xsl:template name = "template1" match="/processXML/process-definition/concurrent-block"> <xsl:copy> <!-- To Copy Concurrent-Blocks --> <!-- From here concurrent-block starts --> <!-- Loop starts picking the first concurrent-block --> <xsl:for-each select="fork"> <xsl:variable name="forkname" select="@name"/> <xsl:apply-templates select="/processXML/process-definition/concurrent-block/fork[@name=$forkname]"/> <xsl:for-each select="transition"> <xsl:variable name="transname"><xsl:value-of select="@to"/></xsl:variable> <xsl:copy-of select="key('act-name', $transname)"/> <xsl:for-each select="key('act-name', $transname)"> <xsl:variable name="joinname" select="transition/@to"/> <xsl:copy-of select="key('jname', $joinname)"/> <xsl:for-each select="key('act-name', $joinname)"> <xsl:copy-of select="key('act-name', $joinname)"/> </xsl:for-each> <!-- Check whether this contains reference to another concurrent-block --> <!-- If it is present then call the template once again to process the concurrent-block subnode--> <xsl:for-each select="key('con-name', $joinname)"> <xsl:call-template name="template1" /> <!-- This node is already populated here.. Hence it should not --> <!-- get populated when it is encountered in the above loop --> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:for-each> </xsl:copy> </xsl:template> </xsl:stylesheet> Hope this helps you understand the problem better. Thanks Sridhar Anupindi From: Wendell Piez <wapiez@xxxxxxxxxxxxxxxx> _________________________________________________________________ Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp Buy and Sell on MSN Classifieds.
|
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
|