Skip to content

fixed xslt stylesheet version / not tested!#47

Merged
bodewig merged 1 commit into
xmlunit:masterfrom
phbenisc:patch-1
Jan 13, 2016
Merged

fixed xslt stylesheet version / not tested!#47
bodewig merged 1 commit into
xmlunit:masterfrom
phbenisc:patch-1

Conversation

@phbenisc

Copy link
Copy Markdown
Contributor

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

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
bodewig added a commit that referenced this pull request Jan 13, 2016
fixed xslt stylesheet version
@bodewig bodewig merged commit d7def83 into xmlunit:master Jan 13, 2016
@bodewig

bodewig commented Jan 13, 2016

Copy link
Copy Markdown
Member

Thanks!

@bodewig

bodewig commented Jan 13, 2016

Copy link
Copy Markdown
Member

Interestingly the .NET version already has the version attribute, I don't recall removing it for Java. Strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants