XML schema validation fails

I

Iluvatar

Hi,

currently I have a little problem upon saving some excel worksheets as
xml data. Normally cell's without a value are not exported into xml,
because in my schema they are marked as optional (see schema below).
But sometimes values are copy-pasted into the worksheet and I'll get
the following error message while saving from the schema validation:
"Error parsing '' as decimal datatype. The attribute 'Exposure' with
value '' failed to parse."

I can't find any differences to other "empty" cells - same format,
formula and value are blank.

Any ideas?

Kind regards,
Michael


Here is the schema I use:

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified">
<xs:element name="test">
<xs:complexType>
<xs:sequence>
<xs:element ref="myType" maxOccurs="unbounded" />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="myType">
<xs:complexType>
<xs:attribute name="Exposure" type="Amount" use="optional" />
</xs:complexType>
</xs:element>
<xs:simpleType name="Amount">
<xs:restriction base="xs:decimal">
<xs:minInclusive value="0" />
<xs:fractionDigits value="12" />
</xs:restriction>
</xs:simpleType>
</xs:schema>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top