You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@xmlbeans.apache.org by "Costello, Robert" <rc...@searshc.com> on 2008/08/01 19:06:37 UTC

referring to type in same namespace

With this sample schema I get the following error when I try to compile
with scomp

 

masteritem.xsd:5:5: error: src-resolve.a: Could not find type
'personinfo@http:/

/www.w3.org/2001/XMLSchema'. Do you mean to refer to the type named
personinfo@m

asteritem (in masteritem.xsd)?

 

<xs:schema

   xmlns:xs="http://www.w3.org/2001/XMLSchema"

   xmlns:mi="masteritem"

   targetNamespace="masteritem">

            <xs:element name="employee" type="personinfo"/>

               <xs:complexType name="personinfo">

                  <xs:sequence>

                     <xs:element name="firstname" type="xs:string"/>

                     <xs:element name="lastname" type="xs:string"/>

                  </xs:sequence>

               </xs:complexType>  

</xs:schema>

 

How do I refer to personinfo such that it knows what namespace it comes
from? 

 

Robert Costello

 


RE: referring to type in same namespace

Posted by "Costello, Robert" <rc...@searshc.com>.
Never mind. This did the trick:

 

<xs:schema

   xmlns:xs="http://www.w3.org/2001/XMLSchema"

   xmlns:mi="masteritem"

   targetNamespace="masteritem">

            <xs:element name="employee" type="mi:personinfo"/>   putting
'mi:' here took care of this.   

               <xs:complexType name="personinfo">

                  <xs:sequence>

                     <xs:element name="firstname" type="xs:string"/>

                     <xs:element name="lastname" type="xs:string"/>

                  </xs:sequence>

               </xs:complexType>  

</xs:schema>

 

Robert Costello

Lead Systems Engineer

IMA Performance

E3- 279A

847.286.0910

 

 

-----Original Message-----
From: Costello, Robert 
Sent: Friday, August 01, 2008 12:07 PM
To: user@xmlbeans.apache.org
Subject: referring to type in same namespace

 

With this sample schema I get the following error when I try to compile
with scomp

 

masteritem.xsd:5:5: error: src-resolve.a: Could not find type
'personinfo@http:/

/www.w3.org/2001/XMLSchema'. Do you mean to refer to the type named
personinfo@m

asteritem (in masteritem.xsd)?

 

<xs:schema

   xmlns:xs="http://www.w3.org/2001/XMLSchema"

   xmlns:mi="masteritem"

   targetNamespace="masteritem">

            <xs:element name="employee" type="personinfo"/>

               <xs:complexType name="personinfo">

                  <xs:sequence>

                     <xs:element name="firstname" type="xs:string"/>

                     <xs:element name="lastname" type="xs:string"/>

                  </xs:sequence>

               </xs:complexType>  

</xs:schema>

 

How do I refer to personinfo such that it knows what namespace it comes
from? 

 

Robert Costello