FW: Relax NG schema?

Here are some comments that I received from Roger Costello.

-----Original Message-----
From: Costello, Roger L. 
Sent: Tuesday, April 15, 2008 2:31 PM
To: Miller, Rob
Subject: RE: Relax NG schema?

Hi Rob,

Here are my comments:

1. There is a definition in the Relax NG schema that doesn't seem to be
equivalent to the corresponding definition in the XML Schema (i.e. they
don't seem to be implementing equivalent things).

2. The Relax NG version uses "anyThing".  I don't see that defined anywhere.

3. I generated a sample instance document using the XML Schema.  This
instance document wouldn't validate against the Relax NG schema.  The error
occurred with the below <Transform> element.

Here's a declaration in the Relax NG version:

    <define name='TransformsType'>
        <oneOrMore><element name='Transform'><ref
name='TransformType'/></element></oneOrMore>
    </define>

    <define name='TransformType'>
        <optional><element name='XPath'><data
type='string'/></element></optional>
        <zeroOrMore><ref name='anyThing'/></zeroOrMore>
        <attribute name='Algorithm'><data type='anyURI'/></attribute>
    </define>    

Here's the corresponding version in the XML Schema version:

  <complexType name="TransformsType">
    <sequence>
      <element ref="ds:Transform" maxOccurs="unbounded"/>  
    </sequence>
  </complexType>

  <element name="Transform" type="ds:TransformType"/>
  <complexType name="TransformType" mixed="true">
    <choice minOccurs="0" maxOccurs="unbounded"> 
      <any namespace="##other" processContents="lax"/>
      <!-- (1,1) elements from (0,unbounded) namespaces -->
      <element name="XPath" type="string"/> 
    </choice>
    <attribute name="Algorithm" type="anyURI" use="required"/> 
  </complexType>

The XML Schema says: "The content of <Transform> is mixed content containing
<XPath> and any element from some other namespace."

The Relax NG schema says: "The content of <Transform> is an optional <XPath>
followed by zero or more "anyThing" (not defined anywhere that I can find).
Note that: (1) It's not allowing mixed content like the XML Schema is
allowing. (2) It's not allowing the elements to occur in any order, as the
XML Schema does.

/Roger C


 

Received on Tuesday, 15 April 2008 19:02:20 UTC