Jump to content

asaafj

Members
  • Posts

    3
  • Joined

  • Last visited

asaafj's Achievements

Newbie

Newbie (1/7)

0

Reputation

  1. I finally found that I had to add something in the XML file as well! When I added xsi:nil="true" to the field in the XML file <NullableDecimalField xsi:nil="true"></NullableDecimalField> it all worked fine!
  2. Thanks for your answer! But... I tried to add 'nillable=true' in the xsd but it still won't accept no value in the NullableDecimalField. Tried to validate a test XML file with XML Spy, but it still says:"Invalid value for datatype decimal in element 'NullableDecimalField'"when I leave the field empty (like this: <NullableDecimalField></NullableDecimalField>)...
  3. Hi!I have a decimal element in my XML structure that is supposed to be optional. However, when trying to leave that element empty I get a SAXParseException:Caused by: org.xml.sax.SAXParseException: cvc-datatype-valid.1.2.1: '' is not avalid value for 'decimal'.I need to put at least '0' (zero) in that element to pass...In the XSD I set a simpleType like this:<xs:simpleType name="dectype"> <xs:restriction base="xs:decimal"/></xs:simpleType>And where this "dectype" is used it is supposed to be optional (minOccurs="0"):<xs:complexType name="authorisationfeedbackitemtype"> <xs:sequence> <xs:element name="NotNullFreeTextField" minOccurs="1" maxOccurs="1" type="stringtype"/> <xs:element name="NullableFreeTextField" minOccurs="0" maxOccurs="1" type="stringtype"/> <xs:element name="NotNullFreeTextField" minOccurs="1" maxOccurs="1" type="stringtype"/> <xs:element name="NotNullFreeTextField" minOccurs="1" maxOccurs="1" type="stringtype"/> <xs:element name="NullableDecimalField" minOccurs="0" maxOccurs="1" type="dectype"/> <xs:element name="NullableFreeTextField" minOccurs="0" maxOccurs="1" type="stringtype"/> <xs:element name="NotNullDateField" minOccurs="1" maxOccurs="1" type="stringtype"/> <xs:element name="NullableFreeTextField" minOccurs="0" maxOccurs="1" type="stringtype"/> </xs:sequence></xs:complexType>Does "xs:decimal" expect a decimal value, I mean can't it be optional? I've tried to look around on the web and haven't found anything saying it's not possible. Or what else can be wrong?Thanks!
×
×
  • Create New...