Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

XSL value using reference number

Avatar of prostang
prostangFlag for United States of America asked on
XML
15 Comments1 Solution250 ViewsLast Modified:
I have limited knowledge of xsl as it applies to referencing and calling other values.  I have an xml file that has a variable name curveSetStopElement that has a numerical value assigned to it.  I need to use that value as an "index" to pull data from another element.

XML:
<?xml version="1.0" encoding="iso-8859-1" ?>
  <GeometryProject name="Pin_Oak_Alignments" description="Alignments-Track 3-26-2014" file="C:\Users\michaelm\Desktop\Pin_Oak_Alignments.alg" lastRevisedDate="10/10/2014 3:42:38 PM" lastRevisedBy="michaelm">
    <HorizontalAlignment name="Track 9" style="Default" curvatureDefinition="chord" lastRevisedDate="10/10/2014 3:42:38 PM" lastRevisedBy="michaelm" area="2006214.8535339" perimeter="4267.5688619" closingDistance="3390.9859322" closingDirection="1.911056883" closingPrecision="1.1861418" northingClosingError="1131.6829624" eastingClosingError="-3196.5730501" fromFeature="false">
      <HorizontalElements>
        <HorizontalLine style="Default" length="160.2993469" direction="0.386580378" elementNumber="5">
          <Start style="Default" northing="568261.5966032" easting="3500224.6073192" elevation="10.0743132" offset="0.0000000" pointType="PT" type="PT">
            <station internalStation="4066.1757150" externalStation="4066.1757150" externalStationName=""/>
          </Start>
          <End style="Default" northing="568410.0664594" easting="3500285.0439174" elevation="9.9706482" offset="0.0000000" pointType="PI" type="PI">
            <station internalStation="4226.4750619" externalStation="4226.4750619" externalStationName=""/>
          </End>
        </HorizontalLine>
        <HorizontalLine style="Default" length="41.0938001" direction="0.453222867" elementNumber="6">
          <Start style="Default" northing="568410.0664594" easting="3500285.0439174" elevation="9.9706482" offset="0.0000000" pointType="PI" type="PI">
            <station internalStation="4226.4750619" externalStation="4226.4750619" externalStationName=""/>
          </Start>
          <End style="Default" northing="568447.0114538" easting="3500303.0374661" elevation="9.9440730" offset="0.0000000" pointType="POE" type="POE">
            <station internalStation="4267.5688619" externalStation="4267.5688619" externalStationName=""/>
          </End>
        </HorizontalLine>
      </HorizontalElements>
      <HorizontalCurveSets>
        </CurvesetPoint>
        <CurvesetPoint tangentDirectionEnd="0.453222867" pointType="POE" type="POE" curveSetStopElement="6" curveSetID="3">
          <GeometryPoint style="Default" northing="568447.0114538" easting="3500303.0374661" elevation="0.0000000" pointType="POE" type="POE">
            <station internalStation="4267.5688619" externalStation="4267.5688619" externalStationName=""/>
          </GeometryPoint>
        </CurvesetPoint>
      </HorizontalCurveSets>
    </HorizontalAlignment>
  </GeometryProject>

XSL:
<xsl:if test="@pointType = 'POE'">
      <tr>
                <!--  ALG NAME -->
	   	        <td align="center" nowrap="nowrap" valign="middle">
	   	            <xsl:value-of select="../../@name"/>
	   	        </td>
				<!--  Point Type   -->
   	            <td align="center">
					<xsl:value-of select="@type"/>
				</td>
				<!--  Distance   -->
   	            <td align="center">
					<!-- <xsl:value-of select="inr:distanceFormat(number(@length), $xslDistancePrecision)"/> -->
					<!-- <xsl:value-of select="inr:distanceFormat(number(@length), $xslDistancePrecision)"/>' -->
					<xsl:value-of select="../../HorizontalElements/HorizontalLine/@length[@elementNumber=$varElement]"/><br/>
				</td>
    </tr>
</xsl:if>
ASKER CERTIFIED SOLUTION
Avatar of Gertone (Geert Bormans)
Gertone (Geert Bormans)Flag of Belgium imageInformation Architect
Commented:
This problem has been solved!
Unlock 1 Answer and 15 Comments.
See Answers