W3C home > Mailing lists > Public > xmlschema-dev@w3.org > May 2005

RE: Creating library schemas which only expose a single document element

From: Michael Kay <mike@saxonica.com>
Date: Mon, 23 May 2005 09:17:32 +0100
To: "'Fraser Crichton'" <fraser.crichton@solnetsolutions.co.nz>, <xmlschema-dev@w3.org>
Message-ID: <E1Da887-0008J8-Qq@maggie.w3.org>
When you eventually come to write schema-aware queries or stylesheets,
you'll find that it's a good idea to make most of your elements global.
 
I would be inclined not to distort the schema design for this purpose. Find
some other way of checking that the top-level element in the instance
document is the one you want it to be.
 
Michael Kay
http://www.saxonica.com/


  _____  

From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Fraser Crichton
Sent: 23 May 2005 03:17
To: xmlschema-dev@w3.org
Subject: Creating library schemas which only expose a single document
element


Hi,


This kind of a follow up to something I posted to XML-DEV -Validating
against the correct root element using library schemas
http://lists.xml.org/archives/xml-dev/200505/msg00263.html (BTW thanks,
Michael and Henry, for getting back to me).


If I'm creating a set of library schemas where I want to enforce that
particular document / message schemas are valid and that no fragments of
documents are valid  it seems I have two approaches  - 

1) I adopt a strict venetian blind approach i.e. there are no global element
declarations in my library schemas and only a Russian doll approach in my
message / document schemas to enforce that there is only one valid root
element (however that way I can't create any reusable elements just reusable
types).

2) I use xsd:group to hide my global elements but get reuse from them by
referencing the groups.

I have a some questions -

Would the xsd:group approach just be a dirty hack? 

Is there any reason why OASIS have not adopted xsd:group (sorry to keep
banging on about OASIS but the New Zealand government are looking at a
number of their standards ;-) )?

Cheers,

Fraser



Attention: This email may contain information intended for the sole use of
the original recipient. Please respect this when sharing or disclosing this
email's contents with any third party. If you believe you have received this
email in error, please delete it and notify the sender or
postmaster@solnetsolutions.co.nz as soon as possible. The content of this
email does not necessarily reflect the views of SolNet Solutions Ltd. 
Received on Monday, 23 May 2005 08:17:47 GMT

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