Note that there are some explanatory texts on larger screens.

plurals
  1. POxsltproc (osx) "not a stylesheet, compilation error". but xml & xsl both work on online tool
    primarykey
    data
    text
    <p>managed to get my xsl working at <a href="http://www.xmlper.com/" rel="nofollow">http://www.xmlper.com/</a> (great tool good recommendation from other stackoverflow comment).</p> <p>but when I run the same (and now highly stripped down) xml &amp; xsl on my mac os x command line I get "compilation error, Document is not a stylesheet" </p> <p>Is it a version issue (output of xsltproc below)? i'm running latest mac (10.7) and latest xcode 4.2 (to ensure xml lib etc)? i couldn't find anything about xsltproc not supporting xslt v2.0 (I've tried setting to v1.0 - no difference) I did try and download other xslt processors (e.g. saxon) but got into old java versions and couldn't get the program to run.</p> <p>hope someone has come across this and has solved it! thanks </p> <p>Ben</p> <p>Input xml file</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;resultsfile&gt; &lt;planset&gt; &lt;voicemail_divert&gt; &lt;cost_over_plan&gt;0&lt;/cost_over_plan&gt; &lt;this_txn_absolutely_cost_subtotal&gt;0&lt;/this_txn_absolutely_cost_subtotal&gt; &lt;/voicemail_divert&gt; &lt;/planset&gt; &lt;/resultsfile&gt; </code></pre> <p>xsl</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" &gt; &lt;xsl:output method="xml"/&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="cost_over_plan"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="@*|node()"/&gt; &lt;/xsl:copy&gt; &lt;extracost_overplan_aspartoftotal&gt;0&lt;/extracost_overplan_aspartoftotal&gt; &lt;extraqty_overplan_aspartoftotal&gt;0&lt;/extraqty_overplan_aspartoftotal&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>error</p> <pre><code>$ xsltproc --debug --novalid --nonet f.xml add_extraqtyandcostfields.xsl compilation error: file f.xml line 2 element resultsfile xsltParseStylesheetProcess : document is not a stylesheet </code></pre> <p>version info</p> <pre><code>$ xsltproc -version Using libxml 20703, libxslt 10124 and libexslt 813 xsltproc was compiled against libxml 20703, libxslt 10124 and libexslt 813 libxslt 10124 was compiled against libxml 20703 libexslt 813 was compiled against libxml 20703 </code></pre>
    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.
    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