Re: Abstract element and xsi:nil

Hi Morris,

Morris Matsa <mmatsa@us.ibm.com> writes:

> xsi:nil doesn't cancel out which attributes are allowed, so the typing
> is still relevant.

What you say appears to be counter-intuitive but true, Structures,
Section 2.6.2:

"XML Schema: Structures introduces a mechanism for signaling that an
 element should be accepted as ·valid· when it has no content despite
 a content type which does not require or even necessarily allow empty
 content. An element may be ·valid· without content if it has the
 attribute xsi:nil with the value true. An element so labeled must be
 empty, but can carry attributes if permitted by the corresponding
 complex type."

I find it quite strange and wonder what is the motivation behind
allowing attributes with xsi:nil=true. This also raises a number
of questions which do not seem to be answered anywhere in the spec:

1. Are such attributes validated?

2. What if the corresponding complex type does not merely permit
   but requires an attribute? Should this attribute be present when
   xsi:nil is true?

Boris

-- 
Boris Kolpackov
Code Synthesis Tools CC
http://www.codesynthesis.com
Open-Source, Cross-Platform C++ XML Data Binding

Received on Monday, 3 September 2007 20:31:37 UTC