Re: Extending XML Schemas

Hi Fatma,

> <xs:schema id="BIDM_VB"
>            targetNamespace="http://tempuri.org/BIDM_VB.xsd"
>            elementFormDefault="qualified"
>            xmlns="http://tempuri.org/BIDM_VB.xsd"
>            xmlns:mstns="http://tempuri.org/BIDM_VB.xsd"
>            xmlns:xs="http://www.w3.org/2001/XMLSchema"
>            xmlns:BIDM="http://tempuri.org/BIDM.xsd"
>            xmlns:VB="http://tempuri.org/VB.xsd">
>
>  <xs:element name="IProject" type="VB:Project" />
>
> </xs:schema>
>
> There is no error in this code but I want to identify the "IProject"
> element whose type is another element of XML schema (VB).

Actually, there is an error in this code because if you refer to a
component in a schema with a different target namespace, then you must
have an xs:import element that imports that namespace:

<xs:schema id="BIDM_VB"
           targetNamespace="http://tempuri.org/BIDM_VB.xsd"
           elementFormDefault="qualified"
           xmlns="http://tempuri.org/BIDM_VB.xsd"
           xmlns:mstns="http://tempuri.org/BIDM_VB.xsd"
           xmlns:xs="http://www.w3.org/2001/XMLSchema"
           xmlns:BIDM="http://tempuri.org/BIDM.xsd"
           xmlns:VB="http://tempuri.org/VB.xsd">

 <xs:import namespace="http://tempuri.org/VB.xsd"
            schemaLocation="VB.xsd" />

 <xs:element name="IProject" type="VB:Project" />

</xs:schema>

You should have a definition for the VB:Project complex type within
the VB.xsd schema document.

But I don't understand what you're having problems with. What do you
mean by "I want to identify the "IProject" element whose type is
another element of XML schema (VB)"? Are you talking about doing this
from code? If so, we need to know what language you're writing in and
what parser you're using to access the document and schema information
in order to help.

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/

Received on Tuesday, 12 March 2002 06:33:41 UTC