You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by Eric Ye <er...@locus.apache.org> on 2001/01/05 20:43:58 UTC

Re: validation failing on correct content

In your schema file:
   <complexType name="providerType">
     <all>
       <element ref="protocol"/>
       <element ref="host"/>
     </all>
     <attribute name="debug" type="boolean" use="optional"/>
   </complexType>

When you reference global scope elements, you need to use QName just as what
you did for "type='...'", like this:
    <element ref="mail:protocol"/>
    <element ref="mail:host"/>

Best regards
_____


Eric Ye * IBM, JTC - Silicon Valley * ericye@locus.apache.org

----- Original Message -----
From: "Kyle F. Downey" <kd...@amberarcher.com>
To: <xe...@xml.apache.org>
Sent: Friday, January 05, 2001 12:26 PM
Subject: validation failing on correct content


>
> Hi,
>
> If I have this source document:
>
> <elog xmlns="http://schemas.a3sr.com/elog/config/"
>       xmlns:mail="http://schemas.a3sr.com/elog/config/mail/"
>       xmlns:xsi="http://www.w3.org/1999/XMLSchema-instance"
>       xsi:schemaLocation="http://schemas.a3sr.com/elog/config/
>                           file:/etc/elog/config.xsd
>                           http://schemas.a3sr.com/elog/config/mail/
>                           file:/etc/elog/mail/config.xsd">
>
>   <listener name="sms-support"
>             class="com.a3sr.elog.listener.MailListener">
>     <format ref="short"/>
>     <mail:provider>
>       <mail:protocol>smpp</mail:protocol>
>       <mail:host>smpp.dev.a3sr.com</mail:host>
>     </mail:provider>
>   </listener>
> </elog>
>
> and this schema for the "mail" namespace:
>
> <schema targetNamespace="http://schemas.a3sr.com/elog/config/mail/"
>         xmlns:mail="http://schemas.a3sr.com/elog/config/mail/"
>         xmlns="http://www.w3.org/1999/XMLSchema"
>         elementFormDefault="qualified">
>
>   <complexType name="providerType">
>     <all>
>       <element ref="protocol"/>
>       <element ref="host"/>
>     </all>
>     <attribute name="debug" type="boolean" use="optional"/>
>   </complexType>
>
>   <element name="provider" type="mail:providerType"/>
>   <element name="protocol" type="string"/>
>   <element name="host" type="string"/>
> </schema>
>
> why does Xerces 1.2.3 fail with this error:
>
> The content of element type "mail:provider" must match
> "((protocol,host)|(host,protocol))"
>
> The content does match that form, with the exception of the
> namespace qualifier, which I think in this situation it should not
> be taking into account (after all, it correctly matched "mail:provider"
> to the "provider" rule). Is this a bug, or am I making a mistake?
>
> regards,
> kd
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: xerces-j-dev-unsubscribe@xml.apache.org
> For additional commands, e-mail: xerces-j-dev-help@xml.apache.org
>
>


Re: validation failing on correct content

Posted by "Kyle F. Downey" <kd...@amberarcher.com>.
> When you reference global scope elements, you need to use QName just as what
> you did for "type='...'", like this:
>     <element ref="mail:protocol"/>
>     <element ref="mail:host"/>
>

That fixed it. Thanks!

regards,
kd