I could not find any existing posts that answered this specific problem. Hopefully it is an easy answer for someone more familiar with XSL: I have a XSL stylesheet that is applied to a XML file generated by a part inspection software system, which then reads the resulting HTML code....
I would like to add an external XML file that contains tolerances for each different part number. So i was imagining the XSL sheet would need to use a document() reference with either the document name or an element in the document defined by the name of an element from the source XML file. Hopefully the included code illustrates what i am trying to do. Obviously it does not work as it stands and is also only a snippet of the whole file....
Thanks for any help or links to something I can learn from.
<xsl:variable name="pname">
<xsl:value-of select="//NAME/."/>.xml
</xsl:variable>
<xsl:template match="TUBE_LRA_ERRORS">
<table border="0" style="font-size:18pt">
<tr><th><xsl:copy-of select="//NAME/."/></th></tr>
<tr><th><xsl:value-of select="//REPORT/REPORT_TIME"/></th></tr>
<tr><th>LRA Errors</th></tr>
</table>
<table border="1" style="font-size:26pt">
<tr align="center" bgcolor="#cccccc">
<td>#</td><td>L</td><td>R</td><td>A</td>
</tr>
<xsl:for-each select="ERROR">
<tr>
<td><xsl:value-of select="position()"/></td>
<xsl:choose>
<xsl:when test="X > document('$pname')/l/hi">
<td bgcolor="00FFFF" style="font-weight:600">
<xsl:value-of select="X"/></td>
</xsl:when>
<xsl:when test="X > document('tolerances.xml')/l/lo">
<td bgcolor="ffffff" style="font-weight:200">
<xsl:value-of select="X"/></td>
</xsl:when>
<xsl:otherwise>