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 UTC