PROV-XML section pattern

XMLers,

(Sorry for the flood of naive comments, this is my first in-depth look. Also, I used to be a bit of an XMLer, but never an XSDer...).

Each concept follows the pattern:
* Definition
* XSD
* the title "Usage in XML"
* (another bit of XSD?)
* an actual example.

(I've pasted the entity section below that follows this pattern.)

1)
Why is the <xs:element> snippet within the "Usage in XML" section? Is it not part of the XML Schema?

2)
Does xs:element/@type align with the xs:complexType/@name?

It seems to me that the order of "Usage in XML" and the xs:element snippet should be swapped.

Thanks,
Tim



An entity is a physical, digital, conceptual, or other kind of thing with some fixed aspects; entities may be real or imaginary.
Type definition in XML Schema:

<xs:complexType xmlns:xs="http://www.w3.org/2001/XMLSchema" name="Entity">
  <xs:sequence>
    <xs:choice minOccurs="0" maxOccurs="unbounded">
      <xs:element ref="prov:location"/>
      <xs:element ref="prov:value"/>
      <xs:element ref="prov:label"/>
      <xs:element ref="prov:type"/>
      <xs:any namespace="##other"/>
    </xs:choice>
  </xs:sequence>
  <xs:attribute ref="prov:id"/>
</xs:complexType>
Usage in XML:

<xs:element xmlns:xs="http://www.w3.org/2001/XMLSchema" name="entity" type="prov:Entity"/>
<prov:document
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:prov="http://www.w3.org/ns/prov#"
    xmlns:ex="http://example.com/ns/ex#"
    xmlns:tr="http://example.com/ns/tr#">

  <prov:entity prov:id="tr:WD-prov-dm-20111215">
    <prov:type xsi:type="xsd:QName">document</prov:type>
    <ex:version>2</ex:version>
  </prov:entity>

</prov:document>

Received on Wednesday, 12 December 2012 19:22:35 UTC