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

SV: SV: empty elements and xsd:string

From: Bryan Rasmussen <brs@itst.dk>
Date: Mon, 21 Feb 2005 17:00:30 +0100
Message-ID: <D45A5694803BE943BA46F9A7262BF83D123658@its42.itst.local>
To: 'George Cristian Bina' <george@oxygenxml.com>
Cc: xmlschema-dev@w3.org

Hi George

Well see this is the thing that bugs me, from version 3 of the xml spec:

'Definition: An element with no content is said to be empty.] The
representation of an empty element is either a start-tag immediately
followed by an end-tag, or an empty-element tag. [Definition: An
empty-element tag takes a special form:]'

the first part of that definition I take to mean there is no whitespace
between the > and the </ so <tag></tag> and I don't see that as being a
lexical representation of a string. I would actually see it as being closest
to a null value. Question, does that lack of space between the > and </
count as a text(), if I do this <xsl:value-of select="count(//text())"/>
against this <tag><hi>  </hi><hi></hi><hi/></tag> I get a value of 1. Anyway
this is how I have always understood it, I am having a hard time considering
that my understanding on this matter may have been wrong. 

I see it as being problematic because if you have an element HouseNumber
which at one point you are treating as a string then  somebody without a
HouseNumber can build their application to generate an empty element, but
then later on if you want to change HouseNumber to actually always require a
number, why this waiting period exists can be explained by all sorts of
boring political things but now if you further constrain HouseNumber you
break people's applications. And all because xsd:string has a privileged
status vis-a-vis the other basic xsd datatypes. 

I'm not sure as to the implications regarding inheritance, but it seems
there should be some. At least for example where redefines are concerned. 



Best Regards,
Bryan Rasmussen


-----Oprindelig meddelelse-----
Fra: George Cristian Bina [mailto:george@oxygenxml.com]
Sendt: 21. februar 2005 16:44
Til: Bryan Rasmussen
Cc: xmlschema-dev@w3.org
Emne: Re: SV: empty elements and xsd:string


Hi Bryan,

 > But I'm wondering now, does this mean that there are also empty
 > nonNegativeIntegers and the like?

No, because empty is not a lexical representation of 0 (zero) for 
instance. The value space for nonNegariveInteger is the infinite set {0, 
1, 2, ...} and empty does not lexically represent any of these values.

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com
Received on Monday, 21 February 2005 16:13:43 GMT

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