W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2001

XSV's handling of <any>

From: Roger L. Costello <costello@mitre.org>
Date: Tue, 16 Jan 2001 06:24:22 -0500
Message-ID: <3A642F66.E95A1F02@mitre.org>
To: xmlschema-dev@w3.org, costello@mitre.org
I am having difficulty with getting xsv to validate an instance document
that conforms to a schema with an <any> element.

For example, here is a snippet of my schema:

  <element name="Book">
     <complexType>
        <sequence>
           <element name="Title" type="string"/>
           <element name="Author" type="string"/>
           <element name="Date" type="string"/>
           <element name="ISBN" type="string"/>
           <element name="Publisher" type="string"/>
           <any namespace="##any"/>
        </sequence>
     </complexType>
  </element>

As you can see, I am allowing for <Book> elements to be extended with
any well-formed XML element, which can come from any namespace.

Also, in this schema I defined a Reviewer element:

  <element name="Reviewer" type="string"/>

I created an instance document, where one of the <Book> elements was
extended with the Reviewer element:

        <Book>
             <Title>My Life and Times</Title>
             <Author>Paul McCartney</Author>
             <Date>1998</Date>
             <ISBN>94303-12021-43892</ISBN>
             <Publisher>McMillin Publishing</Publisher>
             <Reviewer>Roger Costello</Reviewer>
        </Book>

(The default namespace is the schema's targetNamespace.)  Both the
desktop version of xsv, as well as the online Web version of xsv blew up
at this <Book> element.  The error messages from the desktop version of
xsv essentially stated that <Reviewer> was not allowed.  The online, Web
version was less descriptive (see below).  

I believe that I am using the <any> element correctly.  Perhaps not. 
So, is it me that's in error, or is it xsv?  /Roger

Low-level XML well-formedness and/or validity processing output

Warning: Undeclared attribute xsi:schemaLocation for element schema
 in unnamed entity at line 6 char 27 of
http://www.xfront.com/BookCatalogue345.xsd
document element of http://www.book.org/ is not in namespace
http://www.w3.org/2000/10/XMLSchema

Schema resources involved

Attempt to import a schema document from
http://www.xfront.com/BookCatalogue345.xsd for http://www.book.org,
failed

Attempt to import a schema document from http://www.book.org/ for
http://www.book.org, failed
Received on Tuesday, 16 January 2001 06:26:25 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:19 GMT