[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

weird namespace issue with heirarchy of substitution groups.

  • To: xml-dev@l...
  • Subject: weird namespace issue with heirarchy of substitution groups.
  • From: sreedevi crk <sreedevi_crk@y...>
  • Date: Thu, 17 Nov 2005 15:02:37 -0800 (PST)
  • Domainkey-signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=1u+C6/3pLQ3+3n0qmLv+k2ymoD/4RRh2XIp+vGePl2SiT8+iJuSEt/lDZMRcoyXeSDwSKpNkcS8GMAPSghWGfBS2LRudf1NZY7eQbwioQM/LAhzrysBgWk25htOrWZVlrpE5zympKjLtMUeXtf1F8qzxCHNEMaZ3CqPBXBMI9u0= ;

weird groups
Hi all,
 
I posted this issue in all xml/xsd forums, but no solution.Thus trying here.
 
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.

 
During futher investigation, I found that the error occurs when each xsd involving substitution groups has a different namespace and thus has problem with import statement. In other words if I flatten all the xsds that have substitution groups, it works fine.
 Also it works fine when all the xsds are in the same namespace and when include statement is used.   But I want to avoid name collisions by using different namespaces. Does it mean that it is a bug in xml schemas itself??

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: PractitionerParticipation"/>
<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>


http://us.lrd.yahoo.com/_ylc=X3oDMTFqODRtdXQ4BF9TAzMyOTc1MDIEX3MDOTY2ODgxNjkEcG9zAzEEc2VjA21haWwtZm9vdGVyBHNsawNmYw--/SIG=110oav78o/**http%3a//farechase.yahoo.com/

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.