W3C home > Mailing lists > Public > xmlschema-dev@w3.org > February 2003

Re: Top-level any

From: Jeni Tennison <jeni@jenitennison.com>
Date: Thu, 6 Feb 2003 15:16:58 +0000
Message-ID: <17721021327.20030206151658@jenitennison.com>
To: Robin Berjon <robin.berjon@expway.fr>
CC: xmlschema-dev@w3.org

Hi Robin,

> That's not the point. I want to /not/ have a schema for the
> enclosing XML. I just want one for my vocabulary, irrespective of
> what it's embedded in, and I want to be able to use that schema
> whether or not a schema exists for the enclosing XML.

If you assert that the document element in the documents that you're
validating are of the type xsi:anyType then you should get lax
validation down the tree, such that you only validate the elements
that you've declared. So you can do something like:

<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  <fragment xmlns="http://www.example.com">

and the <fragment> element will be validated against the declaration
in fragment.xsd (although actually it won't get validated if it
doesn't have a global element declaration -- there's no way to enforce
strict validation from that point down).

That's the only method I can think of using XML Schema. Of course
using RELAX NG it would be straightforward...



Jeni Tennison
Received on Thursday, 6 February 2003 10:17:48 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:59 UTC