XML.orgXML.org
FOCUS AREAS |XML-DEV |XML.org DAILY NEWSLINK |REGISTRY |RESOURCES |ABOUT
OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] What does an empty element denote?

Minor comments I was tempted to write. Written in-line please,

On 2 June 2015 at 19:13, Michael Kay <mike@saxonica.com> wrote:
I don’t know what validator you are using. It seems Saxon accepts <Test3/> as a valid instance of your Test3 declaration, but I’m inclined to think that it is wrong to do so. XSD 1.0 part 1 section 3.8.4 clause 2 says

<quote>If the {compositor} is choice, then there must be a particle among the {particles} such that the sequence is ·valid· with respect to that particle</quote>

In this case {particles} is empty, so there is no particle for which the sequence is valid, and therefore the sequence is invalid. <xs:choice/> should have no valid instances.

XSD 1.1 says the same thing in much more formal language, which I don’t claim to have fully understood. But it stands to reason: when you have a choice, your content must satisfy at least one branch of the choice, and if there are zero branches, then it cannot possibly do so.

Incidentally, the paper you cite (which, along with Brzozowski’s work, I really must try to understand one day…) seems to use the words “string” and “sequence” interchangeably. Usually in the XML world we use string to mean a string of characters, but in the world of formal grammars, a string is a sequence of symbols from some alphabet,

 
and in the world of schema languages, that alphabet is typically the set of permitted element names.

[mukul] Is it not that, alphabet in the world of schema languages (XSD in particular) consists of the set of permitted element names and also optionally attribute names and XML namespace names? But I think as what made me felt from Mike's point, that XML documents always ought to have elements, but they can have attributes and XML namespaces optionally.

 

Michael Kay
Saxonica



[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS