Loading ...
Sorry, an error occurred while loading the content.

Re: [xml-dbms] Unparseable number ""

Expand Messages
  • rpbourret@rpbourret.com
    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
    Message 1 of 2 , Jul 9, 2004
    • 0 Attachment
      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.

      -- Ron

      > 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:
      > <element_name/>
      > or
      > <element_name></element_name>
      > the execution of The transfer application returns me this error:
      >
      >
      > java.text.ParseException: Unparseable number: ""
      >
      > at
      > org.xmlmiddleware.conversions.formatters.NumberFormatter.parse
      > (NumberFormatter.java:80)
      >
      > at org.xmlmiddleware.xmldbms.DOMToDBMS.setPropertyColumn
      > (DOMToDBMS.java:1090)
      >
      > at org.xmlmiddleware.xmldbms.DOMToDBMS.processProperty
      > (DOMToDBMS.java:807)
      >
      > at org.xmlmiddleware.xmldbms.DOMToDBMS.processChild
      > (DOMToDBMS.java:685)
      >
      > at org.xmlmiddleware.xmldbms.DOMToDBMS.processChildren
      > (DOMToDBMS.java:630)
      >
      > at org.xmlmiddleware.xmldbms.DOMToDBMS.processClassRow
      > (DOMToDBMS.java:544)
      >
      > ..........
      >
      >
      > 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...
    Your message has been successfully submitted and would be delivered to recipients shortly.