carlruiz07 Posted June 21, 2007 Share Posted June 21, 2007 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 comment Share on other sites More sharing options...
eight968 Posted July 7, 2007 Share Posted July 7, 2007 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 comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.