XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Perplexing Invalid Schema

Hi All,

Using Oxygen XML Editor 14 I get this error from Saxon-EE:

F [Saxon-EE 9.4.0.3] The content model of the complex type Z is not a
valid restriction of the content model of the type Item1. Definition
of element I-data differs between the restricted type and the base
type. Type of element in restricted content model is not validly
derived from the type of the corresponding element in base content
model

This is from a simplified example of my real application; so it is
easier to see.

I have a base schema rm-test.xsd and a constraint schema ccd-test.xsd
The two schemas and the instance are included below.

Here are a couple of images of a logical model for the two schemas.
They may or may not help.

http://www.hkcr.net/docs/tmp

If I generate an instance (using Oxygen) for ccd-test.xsd
Of course Oxygen won't validate it because it says the schema is invalid.

xmllint and xmlstarlet both validate the instance against ccd-test.xsd

I was unable to discover how I might execute Saxon-EE outside of Oxygen. ???

The questions are:
1) are xmllint and xmlstarlet too forgiving?
2) is there an issue with Saxon?
3) is there an issue with Saxon inside Oxygen?
4) am I just totally missing something obvious?

Thanks,
Tim

rm-test.xsd
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">

    <xs:complexType name="Any" abstract="true">
        <xs:sequence>
            <xs:element name="A-data" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="DT1">
        <xs:complexContent>
            <xs:extension base="Any">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="DT1-1">
        <xs:complexContent>
            <xs:extension base="DT1">
                <xs:sequence>
                    <xs:element name="dt-data" type="xs:string"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:complexType name="Locate" abstract="true">
        <xs:sequence>
            <xs:element name="L-data" type="xs:string"/>
        </xs:sequence>
    </xs:complexType>

    <xs:complexType name="Definition" abstract="true">
        <xs:complexContent>
            <xs:extension base="Locate">
             </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:complexType name="Item" abstract="true">
        <xs:complexContent>
            <xs:extension base="Definition">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="Item1">
        <xs:complexContent>
            <xs:extension base="Item">
                <xs:sequence>
                    <xs:element name="I-data" type="Any"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="Entry" abstract="true">
        <xs:complexContent>
            <xs:extension base="Definition">
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="Entry1">
        <xs:complexContent>
            <xs:extension base="Entry">
                <xs:sequence>
                    <xs:element name="E-data" type="xs:string"/>
                </xs:sequence>
            </xs:extension>
        </xs:complexContent>
    </xs:complexType>


    <xs:complexType name="ccdType">
        <xs:sequence>
            <xs:element name="defin" type="Locate"/>
        </xs:sequence>
    </xs:complexType>

</xs:schema>

=====================================

ccd-test.xsd
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";
elementFormDefault="qualified">
    <xs:include schemaLocation="rm-test.xsd"/>

    <xs:element name="CCD1" type="Y"/>

    <xs:complexType name="Y">
        <xs:complexContent>
            <xs:restriction base="ccdType">
                <xs:sequence>
                    <xs:element name="defin" type="Z"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>


    <xs:complexType name="Z">
        <xs:complexContent>
            <xs:restriction base="Item1">
                <xs:sequence>
                    <xs:element name="L-data" type="xs:string"
fixed="My L string."/>
                    <xs:element name="I-data" type="X"/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>

    <xs:complexType name="X">
        <xs:complexContent>
            <xs:restriction base="DT1-1">
                <xs:sequence>
                    <xs:element name="A-data" type="xs:string"
fixed="My A string."/>
                    <xs:element name="dt-data" type="xs:string"
fixed="A dt string."/>
                </xs:sequence>
            </xs:restriction>
        </xs:complexContent>
    </xs:complexType>




</xs:schema>

=====================================

instance1.xml
=====================================
<?xml version="1.0" encoding="UTF-8"?>
<CCD1 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
 xsi:noNamespaceSchemaLocation="file:/home/tim/MLHIM/mlhim-specs/schemas/ccd-test.xsd">
    <defin>
        <L-data>My L string.</L-data>
        <I-data>
            <A-data>My A string.</A-data>
            <dt-data>A dt string.</dt-data>
        </I-data>
    </defin>
</CCD1>

=====================================





-- 
============================================
Timothy Cook, MSc           +55 21 94711995
MLHIM http://www.mlhim.org
LinkedIn Profile:http://www.linkedin.com/in/timothywaynecook
Skype ID == timothy.cook
Academic.Edu Profile: http://uff.academia.edu/TimothyCook


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS