OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Escher could have drawn it (Re: XML Schema and Entities)



Dylan Walsh wrote:
> 
> > From: Henry S. Thompson [SMTP:ht@cogsci.ed.ac.uk]
> > Sent: Thursday, June 21, 2001 1:36 PM
> > To:   vdv@dyomedea.com
> > Cc:   xml-dev@lists.xml.org
> > Subject:      Re: Escher could have drawn it (Re: XML Schema and
> > Entities)
> >
> >XML Schema does not have a notion of document element at all, so in
> that
> >sense DOCTYPE is not here to stay, I don't think.
> 
> How does this work in practice? I am not very familiar with XML Schema.
> Lets say somebodies intended XML structure is as follows:
> 
> <?xml version="1.0" ?>
> <a>
>         <b>
>                 <c />
>         </b>
> </a>
> 
> Does this mean that it is impossible to write a XML Schema where this
> document would *not* be valid:
> 
> <?xml version="1.0" ?>
> <b>
>         <c />
> </b>

Yes and no.

It is possible to write a schema where this document is not valid, but
it requires that "a" is the only global element and that may be a stern
constraint for complex vocabularies since some operations are achievable
only on global elements.

> I presume this is not the case, and that <b> and <c> can defined in such
> a way that they can only occur in a certain context. 

Yes, again if b and c are defined as local elements.

> In such a case, you
> could deduce that <a> is the root element, even if it is not explicitly
> marked as such. However, it may be the case that other elements, <x>,
> <y> and <z> could also be defined with the same content model as <a>,
> and therefore there are 4 possible root elements for a schema valid
> document. Is this the case?

Yes, all you have to do is to define these 4 elements as global.

Hope this helps.

Eric
-- 
Pour y voir plus clair dans la nebuleuse XML...
                                          http://dyomedea.com/formation/
------------------------------------------------------------------------
Eric van der Vlist       http://xmlfr.org            http://dyomedea.com
http://xsltunit.org      http://4xt.org           http://examplotron.org
------------------------------------------------------------------------