xsd substitution groups weird problem

    Hi all,
   
  I am trying to solve the problem of validating instance documents of the substitution groups (with abstract elements and complex types) which is more than one level deep. 
   
  Details and the xsds are as follows:

A.1) I tried using abstract complex type/element with substitution groups that are two levels deep.
A.2) But I am unable to validate the calling xsd’s instance document.
The 3 xsds and the xml file code is below. The files related to A.1 are Participation.xsd and Commons3202.xsd.
The files related to A.2 are VitalSigns3203.xsd and VitalSigns3203.xml.

Participation.xsd has a complex abstract type. It is imported and a referenced as the data type of an abstract element in Commons3202.xsd. 
Commons3202.xsd is imported to VitalSigns3203.xsd.

The validation of xml file generated from VitalSigns3203.xsd fails giving the below error:
cvc-complex-type.2.4.a: Invalid content was found starting with element 'signature String'. One of '{"Participation":signatureText}' is expected.
The above error is reproducible in xmlspy, stylus, xerces and jaxp 1.1

Any help in this regard at the earliest is highly appreciated.



The code of each xsd file is as follows:
************************************************** ******************
Paticipation.xsd:
************************************************** ******************
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:PARTICIPATION="Participation" targetNamespace="Participation">
<!-- ================================================= -->
<!-- Package: Participation -->
<!-- ================================================= -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Class: <<ST>> SignatureString -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="signatureString" type="PARTICIPATION:SignatureString" substitutionGroup="PARTICIPATION:signatureText"/>
<xs:complexType name="SignatureString">
<xs:complexContent>
<xs:extension base="PARTICIPATION:SignatureText">
<xs:attribute name="value" type="xs:string" use="required"/>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Class: SignatureText -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="signatureText" type="PARTICIPATION:SignatureText" abstract="true"/>
<xs:complexType name="SignatureText" abstract="true"/>
</xs:schema>
************************************************** *********************
Common3202.xsd:
************************************************** *********************
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:CM3202="Common3202" xmlns:PARTICIPATION="Participation" targetNamespace="Common3202">
<xs:import namespace="Participation" schemaLocation="Datatypes3203/RDT/Participation.xsd"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Class: <<Participation>> PractitionerParticipation -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="practitionerParticipation" type="CM3202:PractitionerParticipation" abstract="true"/>
<xs:complexType name="PractitionerParticipation" abstract="true">
<xs:sequence>
<!--xs:element name="signatureText" type="PARTICIPATION:SignatureText" minOccurs="0"/-->
<xs:element ref="PARTICIPATION:signatureText"/>
</xs:sequence>
</xs:complexType>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Class: <<Participation>> Author -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="author" type="CM3202:Author" substitutionGroup="CM3202 ractitionerParticipation"/>
<xs:complexType name="Author">
<xs:complexContent>
<xs:extension base="CM3202:PractitionerParticipation"/>
</xs:complexContent>
</xs:complexType>

</xs:schema>
************************************************** ******************
VitalSigns3203.xsd
************************************************** *****************
<?xml version="1.0" encoding="ISO-8859-1"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:VS3203="VitalSigns3203" xmlns:CM3202="Common3202" targetNamespace="VitalSigns3203">
<xs:import namespace="Common3202" schemaLocation="Common3202.xsd"/>
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<!-- Class: <<Observation>> VitalSignsObservationEvent -->
<!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -->
<xs:element name="vitalSignsObservationEvent" type="VS3203:VitalSignsObservationEvent"/>
<xs:complexType name="VitalSignsObservationEvent">
<xs:sequence>
<xs:element name="author" type="CM3202:Author" minOccurs="0">
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema>

************************************************** ******************
VitalSigns3203.xml
************************************************** *****************
<?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)-->
<VS3203:vitalSignsObservationEvent xmlns:VS3203="VitalSigns3203" xmlns:CM3202="Common3202" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="VitalSigns3203:\DOCUME~1\vhaislkondas\MYDOCU~1\VHIM3200\VitalSigns3203.xsd">
<CM3202:author>
<signatureString value="String"/> //shows ERROR at this line.
</CM3202:author>
</VS3203:vitalSignsObservationEvent>
   



		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  
--0-1915478469-1132158838=:85742
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<DIV id=RTEContent>  <DIV id=RTEContent>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Hi all,</SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial"></SPAN>&nbsp;</DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">I am trying to solve the problem of validating instance documents of the substitution groups (with abstract elements and complex types) which is more than one level deep. <?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">&nbsp;<o:p></o:p></SPAN></DIV>  <DIV class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: Arial">Details and the xsds are as follows:<BR><BR>A.1) I tried using abstract complex type/element with substitution
 groups that are two levels deep.<BR>A.2) But I am unable to validate the calling xsd’s instance document.<BR>The 3 xsds and the xml file code is below. The files related to A.1 are Participation.xsd and Commons3202.xsd.<BR>The files related to A.2 are VitalSigns3203.xsd and VitalSigns3203.xml.<BR><BR>Participation.xsd has a complex abstract type. It is imported and a referenced as the data type of an abstract element in Commons3202.xsd. <BR>Commons3202.xsd is imported to VitalSigns3203.xsd.<BR><BR>The validation of xml file generated from VitalSigns3203.xsd fails giving the below error:<BR>cvc-complex-type.2.4.a: Invalid content was found starting with element 'signature String'. One of '{"Participation":signatureText}' is expected.<BR>The above error is reproducible in xmlspy, stylus, xerces and jaxp 1.1<BR><BR>Any help in this regard at the earliest is highly appreciated.<BR><BR><BR><BR>The code of each xsd file is as follows:<BR>**************************************************
 ******************<BR>Paticipation.xsd:<BR>************************************************** ******************<BR>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<BR>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:PARTICIPATION="Participation" targetNamespace="Participation"&gt;<BR>&lt;!-- ================================================= --&gt;<BR>&lt;!-- Package: Participation --&gt;<BR>&lt;!-- ================================================= --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;!-- Class: &lt;&lt;ST&gt;&gt; SignatureString --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;xs:element name="signatureString" type="PARTICIPATION:SignatureString" substitutionGroup="PARTICIPATION:signatureText"/&gt;<BR>&lt;xs:complexType name="SignatureString"&gt;<BR>&lt;xs:complexContent&gt;<BR>&lt;xs:extension base="PARTICIPATION:SignatureText"&gt;<BR>&lt;xs:attribute name="value" type="xs:string"
 use="required"/&gt;<BR>&lt;/xs:extension&gt;<BR>&lt;/xs:complexContent&gt;<BR>&lt;/xs:complexType&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;!-- Class: SignatureText --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;xs:element name="signatureText" type="PARTICIPATION:SignatureText" abstract="true"/&gt;<BR>&lt;xs:complexType name="SignatureText" abstract="true"/&gt;<BR>&lt;/xs:schema&gt;<BR>************************************************** *********************<BR>Common3202.xsd:<BR>************************************************** *********************<BR>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<BR>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:CM3202="Common3202" xmlns:PARTICIPATION="Participation" targetNamespace="Common3202"&gt;<BR>&lt;xs:import namespace="Participation" schemaLocation="Datatypes3203/RDT/Participation.xsd"/&gt;<BR>&lt;!--
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;!-- Class: &lt;&lt;Participation&gt;&gt; PractitionerParticipation --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;xs:element name="practitionerParticipation" type="CM3202:PractitionerParticipation" abstract="true"/&gt;<BR>&lt;xs:complexType name="PractitionerParticipation" abstract="true"&gt;<BR>&lt;xs:sequence&gt;<BR>&lt;!--xs:element name="signatureText" type="PARTICIPATION:SignatureText" minOccurs="0"/--&gt;<BR>&lt;xs:element ref="PARTICIPATION:signatureText"/&gt;<BR>&lt;/xs:sequence&gt;<BR>&lt;/xs:complexType&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;!-- Class: &lt;&lt;Participation&gt;&gt; Author --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;xs:element name="author" type="CM3202:Author" substitutionGroup="CM3202 ractitionerParticipation"/&gt;<BR>&lt;xs:complexType
 name="Author"&gt;<BR>&lt;xs:complexContent&gt;<BR>&lt;xs:extension base="CM3202:PractitionerParticipation"/&gt;<BR>&lt;/xs:complexContent&gt;<BR>&lt;/xs:complexType&gt;<BR><BR>&lt;/xs:schema&gt;<BR>************************************************** ******************<BR>VitalSigns3203.xsd<BR>************************************************** *****************<BR>&lt;?xml version="1.0" encoding="ISO-8859-1"?&gt;<BR>&lt;xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:VS3203="VitalSigns3203" xmlns:CM3202="Common3202" targetNamespace="VitalSigns3203"&gt;<BR>&lt;xs:import namespace="Common3202" schemaLocation="Common3202.xsd"/&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;!-- Class: &lt;&lt;Observation&gt;&gt; VitalSignsObservationEvent --&gt;<BR>&lt;!-- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ --&gt;<BR>&lt;xs:element name="vitalSignsObservationEvent" type="VS3203:VitalSignsObservationEvent"/&gt;<BR>&lt;xs:complexType
 name="VitalSignsObservationEvent"&gt;<BR>&lt;xs:sequence&gt;<BR>&lt;xs:element name="author" type="CM3202:Author" minOccurs="0"&gt;<BR>&lt;/xs:element&gt;<BR>&lt;/xs:sequence&gt;<BR>&lt;/xs:complexType&gt;<BR>&lt;/xs:schema&gt;<BR><BR>************************************************** ******************<BR>VitalSigns3203.xml<BR>************************************************** *****************<BR>&lt;?xml version="1.0" encoding="UTF-8"?&gt;<BR>&lt;!--Sample XML file generated by XMLSpy v2005 rel. 3 U (http://www.altova.com)--&gt;<BR>&lt;VS3203:vitalSignsObservationEvent xmlns:VS3203="VitalSigns3203" xmlns:CM3202="Common3202" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="VitalSigns3203:\DOCUME~1\vhaislkondas\MYDOCU~1\VHIM3200\VitalSigns3203.xsd"&gt;<BR>&lt;CM3202:author&gt;<BR>&lt;signatureString value="String"/&gt; //shows ERROR at this line.<BR>&lt;/CM3202:author&gt;<BR>&lt;/VS3203:vitalSignsObservationEvent&gt;<o:p></o:p></SPAN></DIV>  <DIV
 class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></DIV><!-- / message --></DIV></DIV><p>
		<hr size=1> <a href="http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/">Yahoo! FareChase - Search multiple travel sites in one click.</a>

 

 
--0-1915478469-1132158838=:85742--

Received on Thursday, 17 November 2005 01:07:49 UTC