xml-xmlbeans-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Noah Campbell <noahcampb...@gmail.com>
Subject Re: Elements from imported namespaces
Date Fri, 09 Jul 2004 12:15:09 GMT
If memory serves, if you use an XmlAnyType you need to place it last
in your sequence since the schema validator (and xmlbeans) won't know
if BarType is part of BarType or FooElementDocument.

Noah

On Thu, 8 Jul 2004 21:53:57 -0400 (EDT), Nikhil Dinesh
<nikhild@seas.upenn.edu> wrote:
> Hi,
> 
> Im referencing a global element from an imported namespace in my schema.
> But when I read an instance in, the referenced element takes the type
> XmlAnyType instead of the correct one. The schema looks like:
> 
> <schema xmlns:target="http://bar.com"
>         xmlns:foo="http://foo.com"
>         targetNamespace="http://bar.com"
>         elementFormDefault="qualified">
> 
>   <import namespace="http://foo.com" schemaLocation="..." />
> 
>   <complexType name="BarType" >
>     <sequence>
>       <element ref="foo:FooElement" minOccurs="1" maxOccurs="1" />
>       <element name="Bar" type="target:BarType" minOccurs="0" maxOccurs="unbounded"
/>
>     </sequence>
>   </complexType>
> 
> </schema>
> 
> Reading in a FooElementDocument works fine with the elements taking their
> appropriate types. But reading a BarType document results in the
> FooElements having XmlAnyType.
> 
> Ive tried putting the FooElement in both namespaces and setting an
> ErrorListener with the validateOnSet option. But no errors are flagged and
> behaviour is the same whichever I choose. Im reading the document in by
> messaging the SAXHandler.
> 
> Any suggestions as to what I might be doing wrong?
> Thanks,
> Nikhil
> 
> - ---------------------------------------------------------------------
> To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
> For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
> Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/
> 
>

- ---------------------------------------------------------------------
To unsubscribe, e-mail:   xmlbeans-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xmlbeans-user-help@xml.apache.org
Apache XMLBeans Project -- URL: http://xml.apache.org/xmlbeans/


Mime
View raw message