fixed xslt stylesheet version / not tested!#47
Merged
Conversation
I had an Exception using this class because an Oracles oracle.xml.jaxp.JXSAXTransformerFactory. org.xmlunit.ConfigurationException: oracle.xml.xslt.XSLException: <Line 1, Column 58>: XML-22009: (Error) Attribute 'version' not found in 'stylesheet'. org.xmlunit.transform.Transformation.transformTo(Transformation.java:188) org.xmlunit.transform.Transformation.transformToDocument(Transformation.java:220) org.xmlunit.input.CommentLessSource.<init>(CommentLessSource.java:35) org.xmlunit.builder.DiffBuilder.wrap(DiffBuilder.java:344) org.xmlunit.builder.DiffBuilder.build(DiffBuilder.java:330) de.ec4u.adapter.util.XMLUtil.sameXMLDocuments(XMLUtil.java:51) de.ec4u.adapter.message.ResponseBuilderTest.test3_Retrieve(ResponseBuilderTest.java:141) Caused by: javax.xml.transform.TransformerConfigurationException: oracle.xml.xslt.XSLException: <Line 1, Column 58>: XML-22009: (Error) Attribute 'version' not found in 'stylesheet'. oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:402) oracle.xml.jaxp.JXSAXTransformerFactory.newTransformer(JXSAXTransformerFactory.java:291) org.xmlunit.transform.Transformation.transformTo(Transformation.java:172) As the Execption indicates there is the version element missing. A Quote from the XSLT specification: "An xsl:stylesheet element must have a version attribute, indicating the version of XSLT that the stylesheet requires." see http://www.w3.org/TR/xslt#section-Stylesheet-Structure Please be aware that i have NOT tested the solution! Kind regards, Philip
Member
|
Thanks! |
Member
|
Interestingly the .NET version already has the version attribute, I don't recall removing it for Java. Strange. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
I had an Exception using the CommentLessSource classusing Oracles oracle.xml.jaxp.JXSAXTransformerFactory class in the backend:
org.xmlunit.ConfigurationException: oracle.xml.xslt.XSLException: <Line 1, Column 58>: XML-22009: (Error) Attribute 'version' not found in 'stylesheet'.
org.xmlunit.transform.Transformation.transformTo(Transformation.java:188)
org.xmlunit.transform.Transformation.transformToDocument(Transformation.java:220)
org.xmlunit.input.CommentLessSource.(CommentLessSource.java:35)
org.xmlunit.builder.DiffBuilder.wrap(DiffBuilder.java:344)
org.xmlunit.builder.DiffBuilder.build(DiffBuilder.java:330)
de.ec4u.adapter.util.XMLUtil.sameXMLDocuments(XMLUtil.java:51)
de.ec4u.adapter.message.ResponseBuilderTest.test3_Retrieve(ResponseBuilderTest.java:141)
Caused by: javax.xml.transform.TransformerConfigurationException: oracle.xml.xslt.XSLException: <Line 1, Column 58>: XML-22009: (Error) Attribute 'version' not found in 'stylesheet'.
oracle.xml.jaxp.JXSAXTransformerFactory.newTemplates(JXSAXTransformerFactory.java:402)
oracle.xml.jaxp.JXSAXTransformerFactory.newTransformer(JXSAXTransformerFactory.java:291)
org.xmlunit.transform.Transformation.transformTo(Transformation.java:172)
As the Execption indicates there is the version attribute missing.
A Quote from the XSLT specification:
"An xsl:stylesheet element must have a version attribute, indicating the version of XSLT that the stylesheet requires."
see http://www.w3.org/TR/xslt#section-Stylesheet-Structure
Please be aware that i have NOT tested the solution!
Kind regards,
Philip