Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy
Added by Ryan Ternier over 11 years ago
Hey Guys,
I'm getting the following error: Failed to compile stylesheet. 176 errors detected.
When I take the XML I have and the XSLT file I have and run them in Altova XML Spy, they work perfectly. The XSLT was designed in MapForce.
Because there are so many errors I believe that there's only one or two items with the XSLT that Saxon doesn't like.
Here is the XSLT I have. The XSD it's looking at is too big to upload, and I don't want to spam 10k+ lines for this. Because this is failing during the compile and it doesn't yet know about the XML I'll leave that out for now.
Can you see anything that would be blowing up Saxon? I tried to get the inner IKVM error, but for some reason that's not working (working with IKVM on that).
Any help would be appreciated.
Replies (5)
Please register to reply
RE: Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy - Added by Ryan Ternier over 11 years ago
I decided to make a quick standalone app for this and I found the following. xs:int isn't defined?
XPST0080 XPath syntax error at char 0 on line 907 in {xs:int('135'}: The type xs:int is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 910 column 19 of GetPersonSearchResults-To-ArrayOf Member.xslt: XPST0080 XPath syntax error at char 0 on line 910 in {xs:int('135'}: The type xs:int is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 913 column 19 of GetPersonSearchResults-To-ArrayOf Member.xslt: XPST0080 XPath syntax error at char 0 on line 913 in {xs:int('135'}: The type xs:int is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 916 column 19 of GetPersonSearchResults-To-ArrayOf Member.xslt: XPST0080 XPath syntax error at char 0 on line 916 in {xs:int('135'}: The type xs:int is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 919 column 19 of GetPersonSearchResults-To-ArrayOf Member.xslt: XPST0080 XPath syntax error at char 0 on line 919 in {xs:int('128'}: The type xs:int is not recognized by a Basic XSLT Processor. Error at xsl:value-of on line 922 column 19 of GetPersonSearchResults-To-ArrayOf Member.xslt: XPST0080 XPath syntax error at char 0 on line 922 in {xs:int('112'}: The type xs:int is not recognized by a Basic XSLT Processor. javax.xml.transform.TransformerConfigurationException: Failed to compile stylesh eet. 176 errors detected. at net.sf.saxon.PreparedStylesheet.prepare(PreparedStylesheet.java:220) at net.sf.saxon.TransformerFactoryImpl.newTemplates(TransformerFactoryIm pl.java:159) at cli.Saxon.Api.XsltCompiler.Compile(Unknown Source) at cli.Saxon_Parser.Program.TransformToUniformXML(Program.cs:153) at cli.Saxon_Parser.Program.Main(Program.cs:133) at cli.System.AppDomain._nExecuteAssembly(Unknown Source) at cli.Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly(U nknown Source)
RE: Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy - Added by Ryan Ternier over 11 years ago
When I change the XSLT to have xs:string('123') vs xs:int it works.
However, this is a problem because we use MapForce to generate our XSLT's, and the Resulting XSD requires the type to be xs:int.
Is there any way to force Saxon to play nice with this?
RE: Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy - Added by Michael Kay over 11 years ago
The Saxon product packaging is aligned with the conformance levels in the XSLT specification: Saxon-HE implements the "basic" conformance level, and Saxon-EE the "schema-aware" level. A "basic XSLT processor" doesn't recognize xs:int as a built-in type. So to process stylesheets generated by MapForce you need Saxon-PE or Saxon-EE. Alternatively, you can convert all the xs:int references to xs:integer and it should work.
RE: Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy - Added by Ryan Ternier over 11 years ago
I tried the eval. version of EE and it worked for the xs:int but failed when trying to call Altova XSL functions that are in their own domain. Does the Evaluation version of EE/PE come with all features? If so I'll attempt it again.
RE: Saxon - Failed to Compile Stylesheet - 150+ errors. Works perfectly fine in XML Spy - Added by Michael Kay over 11 years ago
No, Saxon doesn't include an implementation of these proprietary Altova functions. I was under the impression it was possible with Mapforce to generate stylesheets without such dependencies, but you'll have to ask Altova about that.
Please register to reply