473,626 Members | 3,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

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="DoubleVal ue" type="xsd:doubl e" nillable="true"/>

In my instance document I have the following element:
<DoubleValue/>
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 xmlns:xsd="http ://www.w3.org/2001/XMLSchema"
xmlns:xsi="http ://www.w3.org/2001/XMLSchema-instance"
xsi:nil="true">
)
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.

Stefan

Jul 20 '05 #1
0 1898

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
2338
by: Anthony Baxter | last post by:
To go along with the 2.4a3 release, here's an updated version of the decorator PEP. It describes the state of decorators as they are in 2.4a3. PEP: 318 Title: Decorators for Functions and Methods Version: $Revision: 1.34 $ Last-Modified: $Date: 2004/09/03 09:32:50 $ Author: Kevin D. Smith, Jim Jewett, Skip Montanaro, Anthony Baxter
0
3512
by: John Jenkins | last post by:
Hi, can someone tell me why the following scneario occurs. With the nillable attribute set to true on an element that has min occurs set to zero, I generate a class. As expected this adds the IsNullable=true attribute <xs:element name="SSN" type="xs:string" minOccurs="0" nillable="true"/> /// <remarks/>
0
1229
by: Greg | last post by:
I'm writing a program which uses the ImportNode function of an XMLDataDocument. This works fine for elements which may appear once at most; however, for elements which may appear multiple times, it inserts 'xsi:nil="true"' for each of those elements, which is a violation of my schema (and logic). (The code below is for cataloging laboratory instruments. The element "calibrationtuid" is a globally unique identification string which...
0
5601
by: info | last post by:
Dear all, is the first time that I use SOAP, and i must say that i'm having several problems. this is SOAP message that expects the server =================XML EXPECTED FROM THE SERVER================ <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
0
1597
by: Bakunin | last post by:
Hi, I have a brief question regarding the .net framework renders class definitions of schemas to wsdl descritions. I have observed the following: 1. I have a schema with a mandatory field (in this example a string) in my schema. 2. When I convert this to a class (using xsd.exe) all is well. There is nothing in the code that is created to suggest that the field create is mandatory or otherwise. 3. When I render run the project and...
2
2852
by: dkmd_nielsen | last post by:
I have two rather simple class methods coded in Ruby...my own each iterator: The iterator is used internally within the class/namespace, and be available externally. That way I can keep everything hidden about the "instructions table." # Loop through each instruction in the block, yielding the result from # the specified code block. def each(&logic) @instructions.each {|instr| yield instr} end
0
1809
by: jazzygirl | last post by:
I'm fairly new to vb.net (self-taught and realizing how much I DON'T know). I need to create an XML output file (I'm quite ignorant in this area as well!). I used an XMLDataDocument and Xml.XmlTextWriter, creating each element node since the agency I'm sending the file to is very specific about the format. How do I specify an element/node/attribute (whatever) to output xsi:nil="true"? Desired Output: <D02 xsi:nil="true" /> ...
0
8262
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8196
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8701
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8637
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5571
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4090
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4196
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1807
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.