Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: Schema Query re import and defines

From: "Kelso, Simon" <skels@--------.--->
To: <xmlschema-dev@--.--->
Date: 5/18/2006 4:49:00 PM
Michael

For the benefit of everyone else the example xsd files are shown below:

Extensions.xsd:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://localnamespace"
elementFormDefault="qualified" xmlns="http://localnamespace"
	xmlns:main="http://mainnamespace"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:import namespace="http://mainnamespace"
schemaLocation="main.xsd" />
	<xs:element name="NewEle">
		<xs:complexType>
			<xs:sequence>
				<xs:sequence>
					<xs:element name="NewSubEle"
type="main:MyComplexType"/>
				</xs:sequence>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
</xs:schema>



Main.xsd:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://mainnamespace"
elementFormDefault="qualified" xmlns="http://mainnamespace"
	xmlns:mstns="http://tempuri.org/XMLSchema.xsd"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
	<xs:element name="TestRootElement">
		<xs:complexType>
			<xs:sequence>
				<xs:element name="ChildElement">
					<xs:complexType>
						<xs:sequence />
					</xs:complexType>
				</xs:element>
			</xs:sequence>
			<xs:attribute ref="testatt"></xs:attribute>
		</xs:complexType>
	</xs:element>
	<xs:element name="TestGlobalEle">
		<xs:complexType>
			<xs:sequence />
		</xs:complexType>
	</xs:element>
	<xs:complexType name="MyComplexType">
	</xs:complexType>
	<xs:attribute name="testatt"></xs:attribute>
</xs:schema>



Plug-in.xsd:

<?xml version="1.0" encoding="utf-8" ?>
<xs:schema targetNamespace="http://mainnamespace"
elementFormDefault="qualified" xmlns="http://mainnamespace"
	xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:import namespace="http://localnamespace"
schemaLocation="Extensions.xsd"/>
<xs:redefine schemaLocation="Main.xsd">
	<xs:complexType name="MyComplexType">
	<xs:complexContent>
	<xs:extension base="MyComplexType">
	   <xs:sequence>
	   <xs:element name="NewRedefinedEle"></xs:element>
	   </xs:sequence>
	</xs:extension>
	</xs:complexContent>
	</xs:complexType>
</xs:redefine>

</xs:schema>



Thanks

Simon






transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent