Re: [xml-dbms] Unparseable number ""
- Nulls are generally represented in XML by missing elements, not empty elements.
(The value of an empty element is a zero-length string, not a null.)
By default, if an element is missing, XML-DBMS will treat it as a NULL. If you
want to use empty elements to represent NULLs -- for example, the XML schema
requires an element to be present, but the database column to which this element
type is mapped is nullable -- then add the EmptyStringIsNull element to the
Options element in your map document.
> Hello, it's me again.
> I have now another problem:
> It seems like element of type integer or float (and maybe every
> number element) cannot be null.
> I mean I have an element of type integer (idem with float) and if in
> my XML file I write:
> the execution of The transfer application returns me this error:
> java.text.ParseException: Unparseable number: ""
> at org.xmlmiddleware.xmldbms.DOMToDBMS.setPropertyColumn
> at org.xmlmiddleware.xmldbms.DOMToDBMS.processProperty
> at org.xmlmiddleware.xmldbms.DOMToDBMS.processChild
> at org.xmlmiddleware.xmldbms.DOMToDBMS.processChildren
> at org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow
> the problem is that my database allows null default values for some
> of integer or float columns and I can't set them to 0 by default. So
> is there a syntax for null values, something like:
> <element_name>null</element_name> ???
> (If I don't write the <element_name> tag into my xml file, the
> process is OK... is this the only solution to work with undefined tag
> values?, that means make many more tests before writing the XML file
> to know which tags don't have to be inserted? - my XML files are
> programmaticly-written- )
> Hard to speek english... I hope it's quite clear even if not
> grammaticaly-perfect : )
> Thank you for your answers.
> Maybe I'll be back soon...