Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


XSD: Problems with restrictions and substitution groups

From: "John Avery" <j.avery@--------.---.-->
To: <xml-dev@-----.---.--->
Date: 12/1/2006 1:52:00 AM
I am extending an exisitng schema for a medical messaging paradigm, to
define a more contrained version of the schema for a specific type of
message.

The oringal schema contains the following elemnt OBX:



And I have created several substitutions for an element called OBX,
these substitutions are restrictions of the OBX element and work fine:

<xsd:complexType name="OBX.PD.NeedHelpToCommunicate.CONTENT">
		<xsd:complexContent>
			<xsd:restriction base="OBX.CONTENT">
				<xsd:sequence>
					<xsd:element ref="OBX.1"
minOccurs="0"/>
					<xsd:element
ref="OBX.2.PD.NeedHelpToCommunicate"/>
					<xsd:element
ref="OBX.3.PD.NeedHelpToCommunicate"/>
					<xsd:element ref="OBX.5"
maxOccurs="unbounded"/>
					<xsd:element ref="OBX.11"/>
				</xsd:sequence>
			</xsd:restriction>
		</xsd:complexContent>
	</xsd:complexType>
<xsd:element name="OBX.PD.NeedHelpToCommunicate"
type="OBX.PD.NeedHelpToCommunicate.CONTENT" substitutionGroup="OBX"/>

<xsd:complexType name="OBX.PD.LanguageSpokenAtHome.CONTENT">
		<xsd:complexContent>
			<xsd:restriction base="OBX.CONTENT">
				<xsd:sequence>
					<xsd:element ref="OBX.1"
minOccurs="0"/>
					<xsd:element
ref="OBX.2.PD.LanguageSpokenAtHome"/>
					<xsd:element
ref="OBX.3.PD.LanguageSpokenAtHome"/>
					<xsd:element ref="OBX.5"
maxOccurs="unbounded"/>
					<xsd:element ref="OBX.11"/>
				</xsd:sequence>
			</xsd:restriction>
		</xsd:complexContent>
	</xsd:complexType>
<xsd:element name="OBX.PD.LanguageSpokenAtHome"
type="OBX.PD.LanguageSpokenAtHome.CONTENT" substitutionGroup="OBX"/>

I now want to restrict the CLINICAL_OBSERVATION element:

  <xsd:complexType name="REF_I12.CLINICAL_OBSERVATION.CONTENT">
    <xsd:sequence>
      <xsd:element ref="OBR" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="OBX" minOccurs="0" maxOccurs="unbounded" />
    </xsd:sequence>
  </xsd:complexType>
  <xsd:element name="REF_I12.CLINICAL_OBSERVATION"
type="REF_I12.CLINICAL_OBSERVATION.CONTENT"/>

To be like this:

  <xsd:complexType name="REF_I12.CLINICAL_OBSERVATION.EONI.CONTENT">
    <xsd:complexContent>
      <xsd:restriction base="REF_I12.CLINICAL_OBSERVATION.CONTENT">
        <xsd:sequence>
            <xsd:element ref="OBR" minOccurs="1" maxOccurs="1" />
            <xsd:element ref="OBX.PD.NeedHelpToCommunicate" minOccurs =
"0"/>
            <xsd:element ref="OBX.PD.LanguageSpokenAtHome" minOccurs =
"0"/>
          </xsd:sequence>
        </xsd:restriction>
    </xsd:complexContent>
  </xsd:complexType>
  <xsd:element name="REF_I12.CLINICAL_OBSERVATION.EONIi"
type="REF_I12.CLINICAL_OBSERVATION.EONI.CONTENT"
substitutionGroup="REF_I12.CLINICAL_OBSERVATION"/>

Certainly on the surface that seems to be a valid restricition of:

<xsd:sequence>
      <xsd:element ref="OBR" minOccurs="1" maxOccurs="1" />
      <xsd:element ref="OBX" minOccurs="0" maxOccurs="unbounded" />
</xsd:sequence>

However I get the rcase-Recurse.2 error "There is not a complete
functional mapping beyween the particles". I believe it has something to
do with the way the substitutiongroups of OBX are expanded to a choice
group, and then validated against my restriction, but I have tried all
kinds of ways of wrapping the sequence in choice and sequence tags to no
avail.

Any help would be much appreciated ... even a link to some software
that can show the expansions or give me a more detailed error message
would be very useful.


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent