[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Getting the attribute of a node knowing the value of o

Subject: Getting the attribute of a node knowing the value of other attribute
From: "Monica Ferrero" <monica.ferrero@xxxxxxxxxxx>
Date: Wed, 29 May 2002 14:41:29 +0100
monica ferrero
Hello!

I am transforming an XML file to LDIF format.
I am trying to get the name of the Subnetwork knowing its id when I am in
the trail object:
Here you can see the XML (it is fixed):

      <Layer id="443__2_2" name="VC4" signalType="VC4">
     <Subnetwork id="342__2_2_1" name="M" >
                ...
     </Subnetwork>
     <Subnetwork id="342__2_2_2" name="T">

     </Subnetwork>


     <TrailList id="344__2_2_17" nsueName="M&lt;-&gt;C" >
       <TopologicalEndPoints>
         <TopologicalEndPointA>
           <SubnetworkRef idref="342__2_2_1"/>
         </TopologicalEndPointA>
         <TopologicalEndPointZ>
           <SubnetworkRef idref="342__2_2_4"/>
         </TopologicalEndPointZ>
       </TopologicalEndPoints>
       <Trail id="355__2_2_17_1" nsueName="M&lt;-&gt;C[1]" >

       </Trail>
     </TrailList>

The XSL:

<xsl:template match="Trail">

     dn: cn=<xsl:value-of select="@name"/>, cn=<xsl:value-of select="../../../../@name"/>, cn=Connectivity
     objectclass: mTrail
     cn: cn=<xsl:value-of select="@name"/>
     id: <xsl:value-of select="@id"/>
                subnetworkA: <xsl:value-of select="../TopologicalEndPoints/TopologicalEndPointA/SubnetworkRef/@idref"/>
     subnetworkA: <xsl:value-of select="../../Subnetwork[@id='342__2_2_1']/@name"/>
     subnetworkA: <xsl:value-of select="../../Subnetwork[@id='{../TopologicalEndPoints/TopologicalEndPointA/SubnetworkRef/@idref}']/@name"/>
</xsl:template>

The result of:
                subnetworkA: <xsl:value-of select="../TopologicalEndPoints/TopologicalEndPointA/SubnetworkRef/@idref"/>
is
     342__2_2_1
and
     subnetworkA: <xsl:value-of select="../../Subnetwork[@id='342__2_2_1']/@name"/>
is
     M
but if I mixed the comands together it does not work:
     subnetworkA: <xsl:value-of select="../../Subnetwork[@id='{../TopologicalEndPoints/TopologicalEndPointA/SubnetworkRef/@idref}']/@name"/>

Any ideas? Any other solution to the problem?

Help is really apreciated!!!

Thanks,

Monica


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.