Re: Globals, locals, and root

"Martin J. Duerst" <duerst@w3.org> writes:

> Are the examples of the primer available somewhere on
> the web? The example.com domain suggests no. It would
> be nice to have them somewhere.

Good idea.

> Does the following example instance conform to the
> po.xsd example in 2.1 of the primer:

> <?xml version='1.0'?>
> <comment>This is just a comment.</comment>

Yes.

> What about the following one:
> 
> <?xml version=1.0'?>
> <comment xmlns='http://www.example.com/PO1'>This is just a comment.</comment>

No.  The schema document in 2.1 of the primer has no 'targetNamespace' 
attribute, so it only validates unqualified elements .

> Assume somebody doesn't like to get comment-only documents like
> the above into his/her order-processing system, and wants to
> use schema validation to avoid it, we get to the next question:

As chapter 7 makes clear, the straightforward way to do this is to
invoke schema-validity assessment with the element declaration or type 
definition you wish to enforce.  I expect most schema validators will
provide a means to specify this.

> For the PurchaseOrder scheme(s), it looks easy to make <comment>
> local (for po.xsd, only two instances), and the penalty that
> these are not 'the same thing' in the schema anymore doesn't
> look that big. But is it possible to e.g. write a schema for
> something like html with everything except <html> local, without
> combinatorial explosion? Does anybody have experience in this
> area?

You could do that, but in my opinion it would be an odd reason to
choose local declarations.  If you insisted, you would avoid the
combinatorial explosion by naming all your types and referencing them
in your local element declarations throughout.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/

Received on Thursday, 12 October 2000 10:26:30 UTC