Note that there are some explanatory texts on larger screens.

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

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload