This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Getting the attribute of a node knowing the value of other attribute


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]