[xsd-users] RE: xsd:ref problem
Balasubramanyam, Shivakumar
sbalasub at qualcomm.com
Thu Mar 6 19:18:35 EST 2008
I am resending this email with complete example, I have simplified the
contents.
Core.xsd looks like below
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:types="types" targetNamespace="types"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:element name="domain" type="xs:string"/>
</xs:schema>
Mtl.xsd
<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:types="types targetNamespace=" types"
elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:include schemaLocation="core.xsd"/>
<xs:element name="mtl" type="xs:string"/>
</xs:schema>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dist="distribution" xmlns:types="types"
targetNamespace="distribution" elementFormDefault="qualified"
attributeFormDefault="unqualified">
<xs:import namespace="types" schemaLocation="core.xsd"/>
<xs:import namespace="types" schemaLocation="mtl.xsd"/>
<xs:element name="params">
<xs:complexType>
<xs:sequence>
<xs:element
ref="types:domain"/>
<xs:element
ref="types:mtl"/>
</xs:sequence>
</xs:complexType>
</xs:element>
</schema>
HTH,
Shiva
________________________________
From: Balasubramanyam, Shivakumar
Sent: Thursday, March 06, 2008 3:43 PM
To: 'xsd-users at codesynthesis.com'
Subject: xsd:ref problem
Hi,
I am using the xsd:ref and I am have some issues. Here is the use case
with some psedo-xsd. I will send actual ones if this is confusing.
core.xsd => namespace = types
<element name="X"/>
FeatureX.xsd => namespace = types
<element name="Y"/>
Application.xsd=> namespace = app
Include core.xsd
Include FeatureX.xsd
<element ref="types.X"/>
<element ref="types.Y"/>
When CS generate the code, reference to X is found but not Y. Any ideas
why?
Why cannot I have two elements in different files in the same namespace?
Thanks,
Shiva
More information about the xsd-users
mailing list