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

laxly assessed elements, xsi:type and xsi:nil

From: Kasimier Buchcik <kbuchcik@4commerce.de>
Date: Tue, 03 May 2005 16:23:27 +0200
To: XML-SCHEMA <xmlschema-dev@w3.org>
Message-Id: <1115130207.1439.24.camel@librax>
xsi nil xsi type

Hi,

while toying with laxly assessed elements in combination with "xsi:type"
and "xsi:nil" I stumbled over a scenario where the schema
processors XSV 2.8, Xerces-J 2.6.2, MSXML 4.0 and MS.NET all behave
differently.

Example:

(any_1.xsd)
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	targetNamespace="urn:test:foo"
	elementFormDefault="qualified">	

	<xsd:element name="foo">
		<xsd:complexType>
			<xsd:sequence>
				<xsd:element name="bar"/>
			</xsd:sequence>
		</xsd:complexType>
	</xsd:element>
</xsd:schema>

(any_1.xml)
<foo 
	xmlns="urn:test:foo"
	xmlns:xsd="http://www.w3.org/2001/XMLSchema"
	xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	xsi:schemaLocation="urn:test:foo any_1.xsd">
	<bar>
		<boo xsi:type="xsd:string" xsi:nil="true">abc</boo>
	</bar>
</foo> 

Xerces-J 2.6.2 eats it.

XSV 2.8 reports:
"element boo is nilled but is not empty".

MSXML 4.0 reports:
"xsi:nil attribute on element 'boo' is invalid.".

MS.NET reports:
"Das urn:test:foo:boo-Element wurde nicht deklariert. Fehler in
'file:///p:/libxml2-lab/tests/2005-04-26/reader_any_1.xml', '(8 und
4)'."
(which means that MS.NET barks about the element "boo" not being
declared)

The behaviour of MS.NET is only understandable when assuming that
it does not allow "lax" assessment.

MSXML reports the attribute "xsi:nil" as invalid, which seems not
correct, since  cvc-type (3.1.1) allows those attributes.

XSV reports the content to be invalid since "nilled", but I cannot
find any rule which takes "xsi:nil" into account, when an element
declaration is not present. This leads directly to the result
of Xerces-J which seems to be the only correct one.

Can someone clarify this?
Should we follow Xerces-J here?

Regards,

Kasimier
Received on Tuesday, 3 May 2005 14:23:35 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.