Note that there are some explanatory texts on larger screens.

plurals
  1. POxslt Ant Task not passing parameters to my stylesheet
    primarykey
    data
    text
    <p>I have a style sheet like this</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:param name="testParam"/&gt; &lt;xsl:template match="@*|node()"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="resources/integer[@name='LOG_LEVEL']/text()"&gt; &lt;xsl:value-of select="$testParam"/&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>And I have an input xml like this:</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resources&gt; &lt;integer name="LOG_LEVEL"&gt;3&lt;/integer&gt; &lt;string name="app_name"&gt;Test Application&lt;/string&gt; &lt;/resources&gt; </code></pre> <p>But when I try to call an xslt transform in ant using this:</p> <pre><code>&lt;xslt in="in.xml" out="out.xml" style="style_above.xsl"&gt; &lt;outputproperty name="method" value="xml"/&gt; &lt;outputproperty name="encoding" value="UTF-8"/&gt; &lt;outputproperty name="indent" value="yes"/&gt; &lt;param name="testParam" expression="test"/&gt; &lt;/xslt&gt; </code></pre> <p>I get the following:</p> <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;resources&gt; &lt;integer name="LOG_LEVEL"/&gt; &lt;string name="app_name"&gt;Test Application&lt;/string&gt; &lt;/resources&gt; </code></pre> <p>it doesn't seem to be changing my xslt parameter to the value I specify in my ant target</p>
    singulars
    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.
    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