You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by "Hollenbeck, Scott" <sh...@verisign.com> on 2001/12/21 15:23:11 UTC
processContents and Namespaces
I have a complex type defined like this:
<complexType name="errValueType" mixed="true">
<sequence>
<any namespace="##any" processContents="skip"/>
</sequence>
<anyAttribute namespace="##any" processContents="skip"/>
</complexType>
and an element of the above type that looks like this:
<value><obj:elem1>2525</obj:elem1></value>
I get the following validation error out of Xerces-J 1.4.4:
[Error] test.xml:9:25: The namespace prefix "obj" was not declared.
and this from Xerces-J 2.0.0 beta4:
[Fatal Error] test.xml:9:25: The prefix "obj" for element "obj:elem1" is not
bound.
The "obj" namespace is not declared in the XML instance, but why do both
Xerces-J 1.4.4 and 2.0.0 beta4 complain about it if namespace="##any" and
processContents="skip"?
-Scott-
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org
RE: processContents and Namespaces
Posted by Julian Reschke <ju...@gmx.de>.
> From: Hollenbeck, Scott [mailto:shollenbeck@verisign.com]
> Sent: Friday, December 21, 2001 3:23 PM
> To: 'xerces-j-user@xml.apache.org'
> Subject: processContents and Namespaces
>
>
> I have a complex type defined like this:
>
> <complexType name="errValueType" mixed="true">
> <sequence>
> <any namespace="##any" processContents="skip"/>
> </sequence>
> <anyAttribute namespace="##any" processContents="skip"/>
> </complexType>
>
> and an element of the above type that looks like this:
>
> <value><obj:elem1>2525</obj:elem1></value>
>
> I get the following validation error out of Xerces-J 1.4.4:
>
> [Error] test.xml:9:25: The namespace prefix "obj" was not declared.
>
> and this from Xerces-J 2.0.0 beta4:
>
> [Fatal Error] test.xml:9:25: The prefix "obj" for element
> "obj:elem1" is not
> bound.
>
> The "obj" namespace is not declared in the XML instance, but why do both
> Xerces-J 1.4.4 and 2.0.0 beta4 complain about it if namespace="##any" and
> processContents="skip"?
This has nothing to do with validation. The document isn't wellformed, so
it's already rejected by a lower processing layer.
---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org