XML Schema do not represent the RM very well. Review necessary

Description

In structure.xsd is following element defined:
<xs:element name="items" type="LOCATABLE"/>
In composition.xsd is the following element defined
<xs:element name="composition" type="COMPOSITION"/>

So, there are only two globally defined elements in the complete schema-structure.

Because Structure.xsd is included in Content.xsd, which is again, included in Composition.xsd, Structure.xsd is in fact the grandparent of all Locatable-derived XMLSchema types.
------------------------------------- The structured XSD's validate OK, that is not the problem. The problem is that they are too restricted to represent the RM.

Only globally-defined elements can be the root element of an XML Schema-based XML-instance.
------------------------------------- So, suppose, I want to create a valid XML instance on base of Content.xsd, only the begin-element "items" is allowed.

So, suppose, I want to create a valid XML instance on base of Structure.xsd, only the begin-element "items" is allowed.

So, suppose, I want to create a valid XML instance on base of Composition.xsd, only the begin-element "items" and the beginelement "composition" is allowed.

I had this discussion in November 2012, Peter Gummer advised me to create a JIRA-entry for this issue.

http://lists.openehr.org/pipermail/openehr-technical_lists.openehr.org/2012-November/007418.html

Environment

None

Activity

Show:
Bert Verhees
May 21, 2015, 1:21 PM

Replacing sequence by choice makes the XML Validator ignore the minOccurs/maxOccurs attributes in the local declarations.

Bert Verhees
May 21, 2015, 3:25 PM

When you want to generate software from a Schema, it depends on the generating tool, then sequence is no problem, but it is possible when you use choice, the software-generating tool, conform the rules of XML Schema 1.1 ignores the minOccurs/maxOccurs attributes.

So to be safe, it is better to use the sequence instead of choice, when the XSD is not used for validating but for generating.

Thomas Beale
May 22, 2015, 9:23 AM

See for suggested RM change for VERSION.data.

Diego Bosca
May 22, 2015, 9:41 AM

But then the "unordered" one is incorrect? Some standards require the attributes to be ordered.

Bert Verhees
May 22, 2015, 10:10 AM

I don't know an example in OpenEHR where this requirement applies

Reporter

Bert Verhees

Labels

Components

Affects versions

Priority

Major
Configure