[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
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<->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<->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
|
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
|