Re: value of a NULL element

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 UTC