Reputation: 3976
I am using an XSLT style sheet to convert an EAD xml file to an html finding aid on the web (pretty standard practice).
However, I have been wanting to preview it in Firefox by referencing the stylesheet at the top of the XML file and opening the XML file with the browser. This is working with a different stylesheet, but with the Stylesheet I want to use, I only get the error:
Error loading stylesheet: XPath parse failure: Name or Nodetype test expected:
It would be really great if I could get more specific error logging so it can tell me where in the XSLT file it is expecting Name or Nodetype test but it does not.
When I open the stylesheet and xml file in Oxygen XML Editor and run the transformation, I get the proper HTML document as a result, so I don't know how to debug it and figure out why it's not rendering from the XML file with the stylesheet referenced. I would prefer it this way because it works better with our workflow to just upload XML files to the same directory on the webserver as the stylesheet (than for me to have to transform the XML file and upload the HTML file to the server...Licenses for Oxygen editor aren't cheap, you know).
Is there anyway to force more details on why this is failing in the browser?
Upvotes: 3
Views: 2838
Reputation: 167716
Oxygen allows you to develop XSLT stylesheets of the versions 1.0, 2.0 and 3.0. The XSLT processors in current browsers however are all XSLT 1.0 processors. Thus if you want to use Oxygen to develop stylesheets to be deployed in browsers then make sure you author XSLT version 1.0 stylesheets and configure Oxygen to use Saxon 6.5 or Xalan, both XSLT 1.0 processors, to run and test your code.
I suspect you use Oxygen with Saxon 9, an XSLT 2.0 processor and thus you run into errors in browsers if you have used any XSLT/XPath 2.0 only constructs in your code.
For instance in XSLT/XPath 2.0 you can write /root/foo/bar/tokenize(., '\|')
where the last step in the path expression is a function call; in XSLT/XPath 1.0 this would give an error.
However Saxonica has brought XSLT 2.0 to browsers as Saxon-CE, an open source project that resulted from cross-compiling Saxon 9 HE to Javascript. That might be an option, see http://saxonica.com/ce/index.xml.
Upvotes: 3
Reputation: 25054
The error reporting from in-browser XSLT 1.0 implementations is typically very poor; if I were you I'd first check the stylesheet with a 1.0 implementation that provides good error messages (say, xsltproc and Saxon 6.5), and then (if the browsers persist in raising errors) by using the usual needle-in-a-haystack kinds of techniques to try to figure out where the problem is arising. If you can figure out where the problem is arising, but not why, then asking on Stack Overflow, or on the xsl-list at Mulberry Technologies will be the logical next step.
Upvotes: 1