- From: Kelso, Simon <skels@allstate.com>
- Date: Thu, 18 May 2006 15:49:09 +0100
- To: <xmlschema-dev@w3.org>
- Message-ID: <A7F3605C579AA64B99E75DBC415CA24B18708B67@a0028-xpo0110-s.intl.ad.allstate.com>
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
Received on Thursday, 18 May 2006 14:51:22 UTC