[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Root element

From: Francis Norton <francis@redrice.com>
Date: Fri, 16 Feb 2001 13:08:48 +0000
Message-ID: <3A8D265F.DCD54ED2@redrice.com>
To: Noah_Mendelsohn@lotus.com
CC: Michael Shapiro <michael@creativescience.com>, xmlschema-dev@w3.org, xmlschema-dev-request@w3.org
Re: Root element
Thanks, Noah. I've updated the FAQ with this, though I've changed the Q.
to 

"Can the message reader force a specific global element to be the
message root?"

and the first sentence of the reply, because I want to make the three
roles - schema author, message author, and message reader - more
explicit.

Hope that's OK -

Francis.

Noah_Mendelsohn@lotus.com wrote:
> 
> I thought the FAQ covered this case, but I checked and it does not do so
> in detail [1].  Here's a bit more info:
> 
> Q. Can any global element serve as the root of your instance when you
> validate?
> A.  Yes, as far as the schema language itself is concerned, but it is
> intended that the application or processor could be parameterized to
> check.  For example, consider a perfectly reasonable processor that would
> take a command line like:
> 
>         validate -instance myinstance.xml -schema myschema.xsd
> -rootElementName purchaseOrder
> 
> such a processor could provide the added service of checking the name of
> the root element.  There are at least two reasons that the schema language
> does not take a more rigid view of roots (a) there are situations in which
> you truly find it useful to have different element names serve as the root
> of  a document and (b) even if purchaseOrder is the root of the instance,
> you may decide that you only want to validate the shippingAddress.   So,
> the root of the validation need not be the root of the instance document.
> 
> Hope this helps.
> 
> [1] http://redrice.com/schemavalid/faq/xml-schema.html#d3
>
Received on Friday, 16 February 2001 08:11:18 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.