Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT in Google App Engine (Java)
    primarykey
    data
    text
    <p>I have this well-formed XSLT file to convert XML files into slightly different XML files. My setup works when I run the tranformation in plain Java, but when I try to run my code on Google App Engine it crashes when I try to load the XSLT file, with the following error message:</p> <pre><code>ERROR: 'null' FATAL ERROR: 'Could not compile stylesheet' javax.xml.transform.TransformerConfigurationException: Could not compile stylesheet at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTemplates(Unknown Source) at com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl.newTransformer(Unknown Source) </code></pre> <hr> <h1>Java:</h1> <p>(Something goes wrong here)</p> <pre><code> InputStream is = context.getResourceAsStream("/xslt/add_spaces_and_ids.xslt"); if (is == null) { throw new NullPointerException("File could not be found"); } Source xsltSource = new StreamSource(is); Transformer transformer = factory.newTransformer(xsltSource); return transformer; </code></pre> <hr> <h1>XSLT:</h1> <p>(Should be nothing special)</p> <pre><code>&lt;?xml version="1.0"?&gt; &lt;xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"&gt; &lt;xsl:strip-space elements="*"/&gt; &lt;xsl:output method="xml" indent="yes"/&gt; &lt;xsl:template match="kop"&gt; &lt;xsl:variable name="kopText"&gt; &lt;xsl:value-of select="."/&gt; &lt;/xsl:variable&gt; &lt;xsl:variable name="titelText"&gt; &lt;xsl:value-of select="titel"/&gt; &lt;/xsl:variable&gt; &lt;!-- Add a space --&gt; &lt;xsl:text&gt; &lt;/xsl:text&gt; &lt;xsl:copy&gt; &lt;xsl:attribute name="id"&gt; &lt;xsl:value-of select="generate-id()" /&gt; &lt;/xsl:attribute&gt; &lt;xsl:apply-templates select="node() | @*"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="node()"&gt; &lt;xsl:text&gt; &lt;/xsl:text&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="node() | @*"/&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;xsl:template match="@*"&gt; &lt;xsl:copy&gt; &lt;xsl:apply-templates select="node() | @*" /&gt; &lt;/xsl:copy&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>How can I fix this?</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.
    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