W3C home > Mailing lists > Public > xmlschema-dev@w3.org > December 2001

Re: value of a NULL element

From: Jeni Tennison <jeni@jenitennison.com>
Date: Wed, 5 Dec 2001 18:01:57 +0000
Message-ID: <4199951152.20011205180157@jenitennison.com>
To: "Morris Matsa" <mmatsa@us.ibm.com>
CC: "maddy pawar" <madhuvanti@hotmail.com>, xmlschema-dev@w3.org
Hi Morris,

>> value of an empty string; if you've declared it as being as type
>> decimal it's not a valid element (because it doesn't have a number as
>> its value) - its lexical value is an empty string.
>
> Is the empty string a legal decimal value? I know several people
> have asked and I can't remember the answer to this anymore, but "0"
> is legal, and "Leading and trailing zeroes are optional." [1] so I
> can see the spec allowing it.

Yeah. Personally I'd read 'leading and trailing zeros' as being zeros
that lead or trail something, and thus that you have to use '0' if you
mean '0', but you might be right.

> Would nil-ed out decimal elements then be of value '0' or the
> default value if one is given?

Actually, looking at the details, if you have:

  <foo xsi:nil="true" />

the [schema normalized value] of the foo element is absent and [nil]
is true.

You could read what I said before as implying that in the PSVI the
element had an empty string as a value - I was wrong to imply that.

I believe (thought I'll wait to be corrected) that even if you declare
foo to be of a simple type whose whiteSpace facet is equal to
collapse, then:

  <foo xsi:nil="true">    </foo>

is invalid because the foo element has [children] (a whitespace-only
text node).

Cheers,

Jeni

---
Jeni Tennison
http://www.jenitennison.com/
Received on Wednesday, 5 December 2001 13:25:00 GMT

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