Thread: small problem
View Single Post
  #1 (permalink)  
Old March 23rd, 2004, 05:43 AM
harjinder_x harjinder_x is offline
Registered User
 
Join Date: Mar 2004
Location: kashipur, ua, India.
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default small problem

Hi all,

I know my question is very basic but i was not able to find a similar code.
I have the original xml like this:


<SIBFlow>

<OPB Name="START" Functionality="ctl_start" Type="START" Comment="It starts a service flow design" SIBFile="\General\start">
<Connection_List>
        <Connection Name="Next" Functionality="on_next()" NextOPB="incoming" Comment="Connection to next OPB"/>
        </Connection_List>
    </OPB>


<OPB Name="incoming" Functionality="incoming" Type="Simple" Comment="Top level action" SIBFile="\User Defined\CPL">
<Connection_List>
        <Connection Name="next node" Functionality="next node" NextOPB="location" Comment="Any node that follows directly"/>
        </Connection_List>
    </OPB>

<OPB Name="location" Functionality="location" Type="Simple" Comment="Specifies location literally." SIBFile="\User Defined\CPL">
<Connection_List>
            <Connection Name="next node" Functionality="Next Node" NextOPB="lookup" Comment="Any node that follows directly."/>
        </Connection_List>
    </OPB>

<OPB Name="lookup" Functionality="lookup" Type="Simple" Comment="To specify location through a external mean." SIBFile="\User Defined\CPL">
<Connection_List>
            <Connection Name="success" Functionality="Next node" NextOPB="location1" Comment="Next node if lookup was successful."/>
</Connection_List>
    </OPB>

<OPB Name="location1" Functionality="location" Type="Simple" Comment="Specifies location literally." SIBFile="\User Defined\CPL">
<Connection_List>
            <Connection Name="next node" Functionality="Next Node" NextOPB="END" Comment="Any node that follows directly."/>
        </Connection_List>
    </OPB>

    <OPB Name="END" Functionality="ctl_end" Type="END" Comment="Ends a service flow design" SIBFile="\General\END">
<Connection_List/>
    </OPB>
</SIBFlow>



The desired output is that we should start from the OPB named-'START' and follow the connections through NEXTOPB,till end.
the output may look like
<cpl>
<incoming>
<location url="hello.com" --- >
<lookup source="test.com" - - - >
<success>
<location url="final.com" - - - />
</success>
</lookup>
</location>
</incoming>
</cpl>



The problem faced in the xslt file is that how to go to the next OPB after reading the value of nextopb.

i have used
<xsl:template match="/opb/connection_list/connection/@NextOPB">

<xsl:apply-templates select="ancestor::SIBFlow/OPB[ @Name= . ]"/>


The problem is that it doesn't pickup the value of nextnode using '.' . So we cannot do the matching and hence cannot go to next node.
Please help me.




































harry