Question

I am trying to run the Saxon CE example on the IBM Developerworks It raises this error:

SaxonCE.XSLT20Processor 23:04:41.615 SEVERE: XPathException in invokeTransform: Either a source document or an initial template must be specified http://localhost:8984/static/SaxonceDebug/7FFD07C49946B3F4B1DE49E72F7E85FA.cache.html Line 876

I can run other Saxon CE examples. Is this some API change?

Was it helpful?

Solution

As the error suggest you need to supply a source document or an initial template.

Something like:

<script>
var onSaxonLoad = function() {
Saxon.run( {
    stylesheet:   "books.xsl",
    source:       "books.xml"
});

or <script type="text/javascript"> var onSaxonLoad = function() { proc = Saxon.run( { stylesheet: 'scripts/stylesheet.xsl', initialTemplate: 'main' } ); }; </script>

Take a look at:

http://www.saxonica.com/ce/user-doc/1.1/index.html#!starting/running

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top