Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Empty Elements: implicit xsi:nil="true" possible ?

Thread Tools

Empty Elements: implicit xsi:nil="true" possible ?

Stefan Prange
Posts: n/a
Hi everyone,

I have a little problem here and wasn't able to find a proper solution
by searching the web. So this newsgroups is my last resort

I have an xml-schema definition of an element which reads:
<xsd:element name="DoubleValue" type="xsd:double" nillable="true"/>

In my instance document I have the following element:
This line is rejected during schema-validating the document with the
message "The value '' of element 'DoubleValue' is not valid."

When I provide the element explicitely with the "xsi:nil"-attribute it's
parsed as valid. This is the valid element:
<DoubleValue xsi:nil="true"/>

(To make this work I had to extend the root element of my schema
definition with the xsi:nil-attribute. It now looks like this:
<xsd:schema xmlnssd=""

Now, my question is:
Is it possible to tell the XML engine to implicity assume the
xsi:nil="true" attribute when it comes across an empty element?
This would let me keep the simpler form of empty elements (<DoubleValue/>).

I'm using Xerces 2.6.2 as XML engine.

Any help is greatly appreciated.
Thanks in advance.


Reply With Quote

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Is it possible to write functions in VHDL with implicit parameters? G Iveco VHDL 4 08-05-2007 05:57 PM
Altova Mapforce - xml 2 xml map: empty elements output although input element is not empty Lukas XML 3 11-10-2005 02:25 PM
possible unicode bug in implicit string concatenation? Fahd Khan Python 1 09-11-2004 07:09 AM
Check if a directory is empty and empty it Marcia Hon C Programming 8 02-14-2004 03:53 AM
empty/non-empty element John XML 1 07-16-2003 10:23 AM