Jump to content

Content Model ambigious.

Recommended Posts

Hi. I am very new in XML schema so excuse me in advanced if a making a huge mistake. I am trying to do the following schema, but when i validated with XML Spy there is generating problem about: <xs:element name="CodingSchemeDesignator"> makes the content model non-deterministic against <xs:element name="CodingSchemeDesignator"> . Possible causes: name equality, overlapping occurance or substitution groups. I don´t undersatand what´s going on. I appreciate if someone can give a hand. Thanks.

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" attributeFormDefault="unqualified">	<xs:element name="person">		<xs:complexType>			<xs:choice>				<xs:group ref="CID244"/>			</xs:choice>		</xs:complexType>	</xs:element>	<xs:group name="CID244">		<xs:choice>			<xs:group ref="G-A100"/>			<xs:group ref="G-A101"/>			<xs:group ref="G-A102"/>			<xs:group ref="G-A103"/>		</xs:choice>	</xs:group>	<xs:group name="G-A100">		<xs:sequence>			<xs:element name="CodingSchemeDesignator" fixed="SRT"/>			<xs:element name="CodeValue" fixed="G-A100"/>			<xs:element name="CodeMeaning" fixed="Right"/>		</xs:sequence>	</xs:group>	<xs:group name="G-A101">		<xs:sequence>			<xs:element name="CodingSchemeDesignator" fixed="SRT"/>			<xs:element name="CodeValue" fixed="G-A101"/>			<xs:element name="CodeMeaning" fixed="Left"/>		</xs:sequence>	</xs:group>	<xs:group name="G-A102">		<xs:sequence>			<xs:element name="CodingSchemeDesignator" fixed="SRT"/>			<xs:element name="CodeValue" fixed="G-A102"/>			<xs:element name="CodeMeaning" fixed="RightandLeft"/>		</xs:sequence>	</xs:group>	<xs:group name="G-A103">		<xs:sequence>			<xs:element name="CodingSchemeDesignator" fixed="SRT"/>			<xs:element name="CodeValue" fixed="G-A103"/>			<xs:element name="CodeMeaning" fixed="Unilateral"/>		</xs:sequence>	</xs:group></xs:schema>

Link to post
Share on other sites
  • 3 weeks later...

The problem is that you have multiple groups that produce the same element types.Both G-A100 and G-A101 have an element called "CodingSchemeDesignator". So you have two groups that can each produce an element of the same name. That's where the ambiguity is.I think part of the problem is you're trying to use fixed to tell the schema what data is in the xml document when schemas are more to say what type of data and what the structure of the documenet should be.So you'd expect to see something like:<element name="person"> <complexType> <sequence> <element name="CodingSchemeDesignator"/> <element name="CodeValue" /> <element name="CodeMeaning" /> </sequence> </complexType></element>There are ways of doing what you want to do, but they aren't exactly nice. See more the abstract example in the next post.

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...