Re: Root element

Michael Shapiro wrote:
> 
> I'm learning the schema language and I have a question that I can't find an
> answer for.
> 
> Primer in http://www.w3.org/TR/xmlschema-0/ declares two elements in
> http://www.example.com/PO1 namespace: <purchaseOrder/> and <comment/>
> 
> Does it mean that an instance document like
> 
> <?xml version="1.0"?>
> <a:comment xmlns:a="http://www.example.com/PO1">
> Hello
> </a:comment>
> 
> is as http://www.example.com/PO1 schema valid as
> the one with <purchaseOrder .../> root?
> 
Yes - see the FAQ [1], let me know if the linkage section [2] needs
improvements.

> If it's the case then is the following document also schema-valid?
> 
> <?xml version="1.0"?>
> <xsd:annotation xmlns:xsd="http://www.w3.org/2000/10/XMLSchema">
>     <xsd:documentation>Hello</xsd:documentation>
> </xsd:annotation>
> 
> Or the identity constraints on the <schema/> element itself will make a
> document with <annotation/> root schema-invalid? What am I missing here?
> 
Yes, it appears to be - XSV is strangely silent on this one, but XML Spy
3.5 validates it, and even better, rejects it if I intentionally
mis-spell the "xsd:documentation" 

Francis.

[1]	http://www.schemavalid.com/
[2]	http://www.schemavalid.com/faq/xml-schema.html#d

Received on Thursday, 15 February 2001 05:59:55 UTC