[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
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 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.