Project

Profile

Help

Bug #4347

closed

Imported schema component model requires XSD version 1.1 when running XQuery with EE license

Added by Radu Coravu over 4 years ago. Updated over 3 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Schema-Aware processing
Sprint/Milestone:
-
Start date:
2019-10-18
Due date:
% Done:

100%

Estimated time:
Legacy ID:
Applies to branch:
9.9
Fix Committed on Branch:
9.9
Fixed in Maintenance Release:
Platforms:

Description

We have an auto test which with Saxon 9.9 attempts to run the XQuery:

analyze-string(doc('test2017080501.xml')/*, '^(:[0-9]+[a-z]*:)(.*)\r?\n', 'im')
over the XML document:

:20:PmtReferenceID000012 :21:Not used :25: PHMNLBICXXX/Account00010203 :28c:00001/0001 ~~~

and with Saxon 9.9 we get the error (this previously worked with Saxon 9.8):

; SystemID: file:/D:/projects/eXml-Saxon9/test/xquery/EXM-39891/sample.xquery; Line#: 1; Column#: 20
net.sf.saxon.type.SchemaException: net.sf.saxon.trans.XPathException: net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:690)
	at net.sf.saxon.Configuration.addSchemaSource(Configuration.java:3156)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:107)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:35)
	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:532)
	at net.sf.saxon.expr.Expression.process(Expression.java:941)
	at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:425)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.runXQuery(XQueryTransformer.java:1215)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.transform(XQueryTransformer.java:949)
	at ro.sync.xml.transformer.xquery.XQueryTransformerTest.testAnalyseStringEXM_39891(XQueryTransformerTest.java:150)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.extensions.jfcunit.JFCTestCase$5.run(JFCTestCase.java:580)
	at junit.extensions.jfcunit.JFCTestCase$3.run(JFCTestCase.java:478)
	at java.lang.Thread.run(Thread.java:745)
Caused by: net.sf.saxon.trans.XPathException: net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:192)
	at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:220)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.tree.tiny.TinyElementImpl.copy(TinyElementImpl.java:433)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.lambda$copy$0(TinyDocumentImpl.java:297)
	at net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:128)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.copy(TinyDocumentImpl.java:297)
	at net.sf.saxon.event.Sender.sendDocumentInfo(Sender.java:249)
	at net.sf.saxon.event.Sender.send(Sender.java:129)
	at com.saxonica.ee.schema.SchemaModelLoader.load(SchemaModelLoader.java:89)
	at com.saxonica.config.EnterpriseConfiguration.importComponents(EnterpriseConfiguration.java:960)
	at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:688)
	... 16 more
Caused by: net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader$SchemaHandler.processElementStart(SchemaModelLoader.java:282)
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:189)
	... 28 more
---------
net.sf.saxon.trans.XPathException: net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:192)
	at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:220)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.tree.tiny.TinyElementImpl.copy(TinyElementImpl.java:433)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.lambda$copy$0(TinyDocumentImpl.java:297)
	at net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:128)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.copy(TinyDocumentImpl.java:297)
	at net.sf.saxon.event.Sender.sendDocumentInfo(Sender.java:249)
	at net.sf.saxon.event.Sender.send(Sender.java:129)
	at com.saxonica.ee.schema.SchemaModelLoader.load(SchemaModelLoader.java:89)
	at com.saxonica.config.EnterpriseConfiguration.importComponents(EnterpriseConfiguration.java:960)
	at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:688)
	at net.sf.saxon.Configuration.addSchemaSource(Configuration.java:3156)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:107)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:35)
	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:532)
	at net.sf.saxon.expr.Expression.process(Expression.java:941)
	at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:425)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.runXQuery(XQueryTransformer.java:1215)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.transform(XQueryTransformer.java:949)
	at ro.sync.xml.transformer.xquery.XQueryTransformerTest.testAnalyseStringEXM_39891(XQueryTransformerTest.java:150)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.extensions.jfcunit.JFCTestCase$5.run(JFCTestCase.java:580)
	at junit.extensions.jfcunit.JFCTestCase$3.run(JFCTestCase.java:478)
	at java.lang.Thread.run(Thread.java:745)
Caused by: net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader$SchemaHandler.processElementStart(SchemaModelLoader.java:282)
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:189)
	... 28 more
---------
net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader$SchemaHandler.processElementStart(SchemaModelLoader.java:282)
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:189)
	at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:220)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.tree.tiny.TinyElementImpl.copy(TinyElementImpl.java:433)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.lambda$copy$0(TinyDocumentImpl.java:297)
	at net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:128)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.copy(TinyDocumentImpl.java:297)
	at net.sf.saxon.event.Sender.sendDocumentInfo(Sender.java:249)
	at net.sf.saxon.event.Sender.send(Sender.java:129)
	at com.saxonica.ee.schema.SchemaModelLoader.load(SchemaModelLoader.java:89)
	at com.saxonica.config.EnterpriseConfiguration.importComponents(EnterpriseConfiguration.java:960)
	at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:688)
	at net.sf.saxon.Configuration.addSchemaSource(Configuration.java:3156)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:107)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:35)
	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:532)
	at net.sf.saxon.expr.Expression.process(Expression.java:941)
	at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:425)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.runXQuery(XQueryTransformer.java:1215)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.transform(XQueryTransformer.java:949)
	at ro.sync.xml.transformer.xquery.XQueryTransformerTest.testAnalyseStringEXM_39891(XQueryTransformerTest.java:150)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.extensions.jfcunit.JFCTestCase$5.run(JFCTestCase.java:580)
	at junit.extensions.jfcunit.JFCTestCase$3.run(JFCTestCase.java:478)
	at java.lang.Thread.run(Thread.java:745)
---------
net.sf.saxon.type.SchemaException: Imported schema component model requires XSD version 1.1
	at com.saxonica.ee.schema.SchemaModelLoader$SchemaHandler.processElementStart(SchemaModelLoader.java:282)
	at com.saxonica.ee.schema.SchemaModelLoader.startContent(SchemaModelLoader.java:189)
	at net.sf.saxon.event.NamespaceReducer.startContent(NamespaceReducer.java:220)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.event.ProxyReceiver.startContent(ProxyReceiver.java:177)
	at net.sf.saxon.tree.tiny.TinyElementImpl.copy(TinyElementImpl.java:433)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.lambda$copy$0(TinyDocumentImpl.java:297)
	at net.sf.saxon.om.SequenceIterator.forEachOrFail(SequenceIterator.java:128)
	at net.sf.saxon.tree.tiny.TinyDocumentImpl.copy(TinyDocumentImpl.java:297)
	at net.sf.saxon.event.Sender.sendDocumentInfo(Sender.java:249)
	at net.sf.saxon.event.Sender.send(Sender.java:129)
	at com.saxonica.ee.schema.SchemaModelLoader.load(SchemaModelLoader.java:89)
	at com.saxonica.config.EnterpriseConfiguration.importComponents(EnterpriseConfiguration.java:960)
	at com.saxonica.config.EnterpriseConfiguration.addSchemaSource(EnterpriseConfiguration.java:688)
	at net.sf.saxon.Configuration.addSchemaSource(Configuration.java:3156)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:107)
	at net.sf.saxon.functions.AnalyzeStringFn.call(AnalyzeStringFn.java:35)
	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:532)
	at net.sf.saxon.expr.Expression.process(Expression.java:941)
	at net.sf.saxon.query.XQueryExpression.run(XQueryExpression.java:425)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.runXQuery(XQueryTransformer.java:1215)
	at ro.sync.xml.transformer.xquery.XQueryTransformer.transform(XQueryTransformer.java:949)
	at ro.sync.xml.transformer.xquery.XQueryTransformerTest.testAnalyseStringEXM_39891(XQueryTransformerTest.java:150)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at junit.extensions.jfcunit.JFCTestCase$5.run(JFCTestCase.java:580)
	at junit.extensions.jfcunit.JFCTestCase$3.run(JFCTestCase.java:478)
	at java.lang.Thread.run(Thread.java:745)


Actions #1

Updated by Radu Coravu over 4 years ago

Attaching again the XML source:

<?xml version="1.0" encoding="UTF-8"?>
<Data>
    :20:PmtReferenceID000012
    :21:Not used
    :25: PHMNLBICXXX/Account00010203
    :28c:00001/0001
</Data> 
Actions #2

Updated by Radu Coravu over 4 years ago

Attaching again the XML source:

<?xml version="1.0" encoding="UTF-8"?>
<Data>
    :20:PmtReferenceID000012
    :21:Not used
    :25: PHMNLBICXXX/Account00010203
    :28c:00001/0001
</Data> 

The problem seems to be that "AnalyzeStringFn" attempts to load an XML Schema "xpath-functions.scm" and this breaks and I do not know what setting to set on our side to make this work.

Actions #3

Updated by Michael Kay over 4 years ago

XSD 1.1 became the default setting in Saxon 9.9, and it looks as if we compiled xpath-functions.xsd with the default settings, which therefore marked the xpath-functions.scm file as being dependent on 1,1,, even though the schema uses no 1.1 features. We'll need to recompile it with the configuration setting xsd-version="1.0" so that it still works if used in a configuration with that setting.

I'm not sure how much longer we want to retain 1.0 support. It's already the case that we're not 100% conformant with the 1.0 spec when you request xsd-version="1.0" -- the non-conformances are mainly in areas where the spec is known to be buggy, such as the rules for valid complex type derivation and edge cases with regular expressions. How many people would worry if 1.1 was always enabled?

Actions #4

Updated by Radu Coravu over 4 years ago

I think most people don't know that XML Schema has two versions :) But as long as you have a choice in the code between 1.0 and 1.1 the analyze-string() should probably work in both cases. Is 1.1 a perfect superset of 1.0? Because if so it would not matter much... right now in our code we set the XSD version in the Saxon configuration depending on our Oxygen Preferences which still have 1.0 as default.

Actions #5

Updated by Michael Kay about 4 years ago

  • Category set to Schema-Aware processing
  • Status changed from New to In Progress
  • Assignee set to Michael Kay
  • Applies to branch 9.9 added

The version of xpath-functions.scm shipped with 10.0 is labelled xsdVersion="1.0", so it seems we quietly fixed this. The version in 9.9.1.7, however, is still labelled xsdVersion="1.1".

I'll copy the 1.0 version into the 9.9 repository so the next maintenance build should pick it up.

Actions #6

Updated by Michael Kay about 4 years ago

  • Status changed from In Progress to Resolved
  • Priority changed from Low to Normal
  • Fix Committed on Branch 9.9 added
  • Fixed in Maintenance Release 10.0 added

Fixed as suggested.

Actions #7

Updated by O'Neil Delpratt over 3 years ago

  • Status changed from Resolved to Closed
  • % Done changed from 0 to 100
  • Fixed in Maintenance Release 9.9.1.8 added

Bug fix applied on the Saxon 9.9.1.8 maintenance release.

Please register to edit this issue

Also available in: Atom PDF