RE: Basics of XML Schema inheritance

bccing www-tag as it's not an appropriate alias.

Rajesh,

There are several options:

1.	Use restriction rather than extension ( you want to restrict the
wildcard to be a particular element ). 

2.    Pass the SOAP 1.1 schema and the schema for SenderId and
DocumentID elements to you validator. A good validation tool will
validate correctly. 

3.	Copy-and-edit the SOAP 1.1 schema, adding an import for your
schema and changing the wildcards to element references.

Regards

Martin Gudgin


> -----Original Message-----
> From: www-tag-request@w3.org [mailto:www-tag-request@w3.org] 
> On Behalf Of Rao, Rajesh
> Sent: 12 September 2003 17:01
> To: www-tag@w3.org
> Subject: Basics of XML Schema inheritance
> 
> 
> 
> Hello All,
> 
> I have a simple SOAP message for which I would like to define 
> a XML Schema. This SOAP message has just 2 elements.
> 
> Could any of you please help me out on this one?
> 
> <SOAP-ENV:Envelope 
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> 		<CPG-ENV:SenderID 
> xmlns:CPG-ENV="http://www.cpgmarket.com/soap/">9999998000</CPG
> -ENV:CPGSenderID>
> <SOAP-ENV:Body>
> 		<CPG-ENV:DocumentID 
> xmlns:CPG-ENV="http://www.cpgmarket.com/soap/">Z20300000000004
> 36060</CPG-ENV: DocumentID> </SOAP-ENV:Envelope>
> 
> I have defined an XML Schema based on my understanding, which 
> goes like this
> 
> <?xml version="1.0"?>
> <xsd:schema 
> targetNamespace="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:cpg="http://www.cpgmarket.com/soap/" 
> xmlns:tns="http://schemas.xmlsoap.org/soap/envelope/" 
> xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:redefine 
> schemaLocation="http://schemas.xmlsoap.org/soap/envelope/">
> 		<xsd:complexType name="Header">
> 			<xsd:complexContent>
> 				<xsd:extension base="Header">
> 					<xsd:sequence>
> 						<xsd:element 
> name="SenderID" minOccurs="0"/>
> 					</xsd:sequence>
> 				</xsd:extension>
> 			</xsd:complexContent>
> 			<xsd:anyAttribute namespace="##any" 
> processContents="lax"/>
> 		</xsd:complexType>
> 	</xsd:redefine>
> 	<xsd:redefine 
> schemaLocation="http://schemas.xmlsoap.org/soap/envelope/">
> 		<xsd:complexType name="Body">
> 			<xsd:complexContent>
> 				<xsd:extension base="Body">
> 					<xsd:sequence>
> 						<xsd:element 
> name="DocumentID" minOccurs="0"/>
> 					</xsd:sequence>
> 				</xsd:extension>
> 			</xsd:complexContent>
> 			<xsd:anyAttribute namespace="##any" 
> processContents="lax"/>
> 		</xsd:complexType>
> 	</xsd:redefine>
> </xsd:schema>
> 
> As you people can guess it does not work.
> 
> Any input/suggestions would be highly appreciated.
> 
> Regards,
> 
> Rajesh
> 
> 
> The information transmitted is intended only for the person 
> or entity to which it is addressed (www-tag@w3.org) and may 
> contain confidential and/or privileged material. 
> Any review, retransmission, dissemination or other use of, or 
> taking of any action in reliance upon, this information by 
> persons or entities other than the intended recipient is prohibited. 
> If you received this in error, please contact the sender and 
> delete the material from any computer.
> 
> 
> 

Received on Friday, 12 September 2003 15:15:36 UTC