W3C home > Mailing lists > Public > xmlschema-dev@w3.org > September 2007

Re: Abstract element and xsi:nil

From: Boris Kolpackov <boris@codesynthesis.com>
Date: Mon, 3 Sep 2007 22:25:26 +0200
To: Morris Matsa <mmatsa@us.ibm.com>
Cc: Dennis Sosnoski <dms@sosnoski.com>, xmlschema-dev@w3.org
Message-ID: <20070903202526.GB2370@karelia>

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

This archive was generated by hypermail 2.3.1 : Wednesday, 10 December 2014 20:01:58 UTC