[oXygen-user] How Does Oxygen Validate This Dublin Core Schema?

Eliot Kimber
Fri Mar 7 12:15:17 CST 2008


In testing our own schema-based validation features in our RSuite 
product we discovered that as far as we can tell Xerxes 2.9.x fails to 
validate the valid Dublin Core schema given below. This is a documented 
problem with Xerces in that it doesn't handle the particular pattern of 
restriction and substitution groups used in this schema.

However, Oxygen happily (and correctly) validates documents using this 
schema (that is, our test case fails when we parse it with our 
Xerces-based code but Oxygen reports it as valid).

My understanding was that Oxygen used Xerces for its schema processing, 
so my question is: what does Oxygen do special that allows it to process 
this case, or is our understanding of Xerces flawed?

The failure we get is than an instance of e.g., dc:title is reported by 
Xerces as not allowing character data content when of course it does.

The original discussion of this issue from the Dublin Core people is here:

   http://dublincore.org/schemas/xmls/qdc/2008/02/11/notes/

Very near the bottom is this:

     This derivation of a complexType with simpleContent by restriction 
of a base complexType with complexContent is valid under section 3.4.6 
of XML Schema Part 1: Structures, specifically item 5.1.2 of the section 
"Schema Component Constraint: Derivation Valid (Restriction, Complex)", 
because the base complexContent is mixed and emptiable.

     This was confirmed by Henry Thompson, see e.g.
     http://www.w3.org/2001/05/xmlschema-rec-comments#pfiSimpleContent
     http://lists.w3.org/Archives/Public/xmlschema-dev/2002Oct/0005.html
     http://lists.w3.org/Archives/Public/xmlschema-dev/2002Oct/0008.html

     Conclusion: Xerces appears to be behaving incorrectly in rejecting 
this derivation.


Thanks,

Eliot

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
            xmlns="http://purl.org/dc/elements/1.1/"
            targetNamespace="http://purl.org/dc/elements/1.1/"
            elementFormDefault="qualified"
            attributeFormDefault="unqualified">

   <xs:annotation>
     <xs:documentation xml:lang="en">
       DCMES 1.1 XML Schema
       XML Schema for http://purl.org/dc/elements/1.1/ namespace

       Created 2003-04-02

       Created by

       Tim Cole ()
       Tom Habing ()
       Jane Hunter ()
       Pete Johnston (),
       Carl Lagoze ()

       This schema declares XML elements for the 15 DC elements from the
       http://purl.org/dc/elements/1.1/ namespace.

       It defines a complexType SimpleLiteral which permits mixed content
       and makes the xml:lang attribute available. It disallows child 
elements by
       use of minOcccurs/maxOccurs.

       However, this complexType does permit the derivation of other 
complexTypes
       which would permit child elements.

       All elements are declared as substitutable for the abstract 
element any,
       which means that the default type for all elements is 
dc:SimpleLiteral.

     </xs:documentation>

   </xs:annotation>


   <xs:import namespace="http://www.w3.org/XML/1998/namespace"
              schemaLocation="http://www.w3.org/2001/03/xml.xsd">
   </xs:import>

   <xs:complexType name="SimpleLiteral">
         <xs:annotation>
         <xs:documentation xml:lang="en">
             This is the default type for all of the DC elements.
             It permits text content only with optional
             xml:lang attribute.
             Text is allowed because mixed="true", but sub-elements
             are disallowed because minOccurs="0" and maxOccurs="0"
             are on the xs:any tag.

     	    This complexType allows for restriction or extension permitting
             child elements.
     	</xs:documentation>
   	</xs:annotation>

    <xs:complexContent mixed="true">
     <xs:restriction base="xs:anyType">
      <xs:sequence>
       <xs:any processContents="lax" minOccurs="0" maxOccurs="0"/>
      </xs:sequence>
      <xs:attribute ref="xml:lang" use="optional"/>
     </xs:restriction>
    </xs:complexContent>
   </xs:complexType>

   <xs:element name="any" type="SimpleLiteral" abstract="true"/>

   <xs:element name="title" substitutionGroup="any"/>
   <xs:element name="creator" substitutionGroup="any"/>
   <xs:element name="subject" substitutionGroup="any"/>
   <xs:element name="description" substitutionGroup="any"/>
   <xs:element name="publisher" substitutionGroup="any"/>
   <xs:element name="contributor" substitutionGroup="any"/>
   <xs:element name="date" substitutionGroup="any"/>
   <xs:element name="type" substitutionGroup="any"/>
   <xs:element name="format" substitutionGroup="any"/>
   <xs:element name="identifier" substitutionGroup="any"/>
   <xs:element name="source" substitutionGroup="any"/>
   <xs:element name="language" substitutionGroup="any"/>
   <xs:element name="relation" substitutionGroup="any"/>
   <xs:element name="coverage" substitutionGroup="any"/>
   <xs:element name="rights" substitutionGroup="any"/>

   <xs:group name="elementsGroup">
   	<xs:annotation>
     	<xs:documentation xml:lang="en">
     	    This group is included as a convenience for schema authors
             who need to refer to all the elements in the
             http://purl.org/dc/elements/1.1/ namespace.
     	</xs:documentation>
   	</xs:annotation>

   <xs:sequence>
     <xs:choice minOccurs="0" maxOccurs="unbounded">
       <xs:element ref="any"/>
     </xs:choice>
     </xs:sequence>
   </xs:group>

   <xs:complexType name="elementContainer">
   	<xs:annotation>
     	<xs:documentation xml:lang="en">
     		This complexType is included as a convenience for schema authors 
who need to define a root
     		or container element for all of the DC elements.
     	</xs:documentation>
   	</xs:annotation>

     <xs:choice>
       <xs:group ref="elementsGroup"/>
     </xs:choice>
   </xs:complexType>


</xs:schema>


-- 
Eliot Kimber
Senior Solutions Architect
"Bringing Strategy, Content, and Technology Together"
Main: 610.631.6770
www.reallysi.com
www.rsuitecms.com



More information about the oXygen-user mailing list