How can I dynamically specify the href value in the line
<?xml-stylesheet type="text/xsl" href="first.xsl"?>
in an xml?
I would like to substitute "first.xsl" dynamically.
Thanks for your help. ================== Apologies for messing this up/making it difficult for you to help ====
My XML is:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="first.xsl"?>
<WinData records="1" fields="4">
<record id="1">
<Name type="82">January</Name>
<Dept type="323">19</Dept>
<InceptionDate type="82">01/01/2010</InceptionDate>
<Salary type="645">3729.71</Salary>
</record>
<!-- Created from D:\AJAY\C#\VS2010\SBWA\XML -->
</WinData>
The XSL is:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>Sub Selection of Data</h2>
<table border="0">
<tr bgcolor="#9acd32">
<th>Name</th>
<th>Dept</th>
<th>InceptionDate</th>
<th>Salary</th>
</tr>
<xsl:for-each select="WinData/record" >
<xsl:sort select="./Name"/>
<xsl:sort select="./Dept"/>
<xsl:if test="Salary>100">
<tr>
<td><xsl:value-of select="Name"/></td>
<td><xsl:value-of select="Dept"/></td>
<td><xsl:value-of select="InceptionDate"/></td>
<td><xsl:value-of select="Salary"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
My specific issues/objectives:
- How can I incorporate the code snippet offerred by iHeartGreek?
- Is there a way to pass the 'replacement' xsl (newLink.xsl in the snippet) as a parameter?