[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

Subject: Re: Re:Help needed in recursively converting the flat xml to a heirarchical XML...
From: "Sridhar Anupindi" <sridharanupindi@xxxxxxxxxxx>
Date: Wed, 31 Mar 2004 02:35:02 +0530
xslt node is populated
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>
Reply-To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
To: xsl-list@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Re:Help needed in recursively converting the flat xml to a heirarchical XML...
Date: Tue, 30 Mar 2004 15:00:55 -0500


Sridhar,

At 02:07 PM 3/30/2004, you wrote:
I think I made a significant progress with your explanation. Thanks, But still I am stuck with some problems.

1. As you said, I tried replacing


_________________________________________________________________
Post Classifieds on MSN classifieds. http://go.msnserver.com/IN/44045.asp Buy and Sell on MSN Classifieds.


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.