Re: Attributes and Default Namespaces

Mukul Gandhi <[email protected]>
Newsgroups gmane.text.xml.schema.devel
Message-ID <[email protected]>
On Fri, Nov 12, 2010 at 12:30 PM, Mukul Gandhi <[email protected]> wrote:
> <xs:element name="Results">
>     <xs:annotation>
>         <xs:documentation>Comment describing your root
> element</xs:documentation>
>     </xs:annotation>
> </xs:element>

There is a slight correction I want to make to what I wrote earlier.
For an XML schema fragment like above the schema type of element
"Results" is indeed xs:anyType. But if there is an "non null"
targetNamespace attribute on xs:schema instruction, in such a schema I
think a compliant XML Schema validator must report validation errors
(as you originally got -- so that was correct I think). This is so
because, if in instance document we have something like:

<Results xmlns="http://raid.raidllp.com">
    ...
</Results>

then the schema validator won't be able to find an element declaration
for element "Results" (in the specified namespace), since the schema
type of "Results" must be in namespace http://raid.raidllp.com (but
for an element declaration like <xs:element name="Results" /> the
schema type is xs:anyType and this is in namespace
http://www.w3.org/2001/XMLSchema).




-- 
Regards,
Mukul Gandhi
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.