Page 1 of 1

Possible Bug with XML Schema 1.1 override

Posted: Mon Feb 15, 2021 12:57 am
by fsteimke
Hi,

I have to use the XSD Schema 1.1 feature xs:override for the first time, and found something that looks like a bug. The real use Case deals with a complex ebXML Schema construct (XML Schema 1.0). For the purpose of demonstration i have two very simple Schema files.

The first one has no versioning attributes in the Namespace http://www.w3.org/2007/XMLSchema-versioning . It is called Base.xsd and defines the global root Element with child Elements called child

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    elementFormDefault="qualified"
    targetNamespace="http://demo.com" xmlns:tns="http://demo.com">

    <xs:element name="root">
        <xs:complexType>
            <xs:sequence>
                <xs:element maxOccurs="unbounded" name="child" type="xs:token"/>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>
The second Schema File called Overriding.xsd is of Version 1.1. I overrides the root Element from Base.xsd, so that child Elements are called subelement.

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
    xmlns:vc="http://www.w3.org/2007/XMLSchema-versioning" elementFormDefault="qualified"
    vc:minVersion="1.1" targetNamespace="http://demo.com" xmlns:tns="http://demo.com">

    <xs:override schemaLocation="Base.xsd">
        <xs:element name="root">
            <xs:complexType>
                <xs:sequence>
                    <xs:element name="subelement" maxOccurs="unbounded" type="xs:positiveInteger"/>
                </xs:sequence>
            </xs:complexType>
        </xs:element>
    </xs:override>
</xs:schema>
What happens is that when i validate the Overriding Schema File with XERCES as Default Schema Validation Engine, the schema File is valid;

But when i validate the same Overriding Schema File with Saxon EE, i get the following Error:
System ID: /home/frank/override.xsl
Main validation file: /home/frank/test/Overriding.xsd
Engine name: Saxon-EE 9.9.1.7
Severity: error
Description: <xs:schema> must be the outermost element in a schema document

It is most interesting, that the Resource / System ID says "/home/frank/override.xsl", although there is no such file.

This happens in Oxygen 23 build 2020111805 on Linux.

Thanks in Advance,
Frank

Re: Possible Bug with XML Schema 1.1 override

Posted: Mon Feb 15, 2021 8:15 pm
by tavy
Hello,

Thanks for your feedback.
There is a problem with the Saxon validation, I already reported this problem at Saxon, and they fixed it. Here is the Saxon issue: https://saxonica.plan.io/issues/4518
We need to update the default Saxon library in Oxygen, probably in the next Oxygen major release.

Best Regards,
Octavian

Re: Possible Bug with XML Schema 1.1 override

Posted: Fri Mar 11, 2022 4:54 pm
by tavy
Hello Frank,

Just want to let you know that we released Oxygen version 24.1. The issue that you reported should be fixed.

The new version includes Saxon 10.6 as built-in transformer, as well as Saxon 10.7 and Saxon 11.2 as add-ons.

For the complete list of features, you can go to:
https://www.oxygenxml.com/xml_editor/wh ... SLT_XQuery

Best Regards,
Octavian

Re: Possible Bug with XML Schema 1.1 override

Posted: Wed Jun 08, 2022 6:22 pm
by andersbonielsen
This seems to be related to:
https://issues.apache.org/jira/browse/XERCESJ-1674
https://issues.apache.org/jira/browse/XERCESJ-1627
Does Oxygen version 24.1 also fix the issue XERCESJ-1627 reported by Octavian Nadolu?
Note that XERCESJ-1674 is stated as "Resolved" by assignee Mukul Gandhi whereas XERCESJ-1627 is still stated as "Open" by assignee Mukul Gandhi.
Best regards, Anders Bo Nielsen

Re: Possible Bug with XML Schema 1.1 override

Posted: Thu Jun 09, 2022 6:27 pm
by tavy
Hello,

The issues are similar but XERCESJ-1674 does not fix XERCESJ-1627. In the issue that I reported it seems that there is a problem with the order of resolving the import and overwrite, as Mukul explains on that issue.

Best Regards,
Octavian