Re: [xml] "double"s and schema validation



On 21 July 2010 00:54, Dan Sommers <dan tombstonezero net> wrote:
On 2010-07-20 at 12:56:45 +0100,
Richard Quadling <rquadling gmail com> wrote:

On 20 July 2010 02:40, Dan Sommers <dan tombstonezero net> wrote:

 http://www.w3.org/TR/xmlschema-2/#decimal

http://www.w3.org/TR/xmlschema-2/#double, not decimal.

I should have included both links: ÂThe spec for double refers to the
spec for decimal, and it's the decimal spec that allows the "." in the
mantissa portion of a double.

As 'e' is an optional part of a double, can you try a different value.
Something like 'FooBar'. Anything really.

$ xmllint --schema t.xsd t.xml
<?xml version="1.0"?>
<t>FooBar</t>
t.xml:1: element t: Schemas validity error : Element 't': 'FooBar' is not a valid value of the atomic type 
'xs:double'.
t.xml fails to validate

Thanks,
Dan
_______________________________________________
xml mailing list, project page Âhttp://xmlsoft.org/
xml gnome org
http://mail.gnome.org/mailman/listinfo/xml


At a guess, it potentially looks like a faulty schema. At least in
terms of what the documentation says.

From reading the documentation the regex pattern should/could look like ...

^-?(?:[1-9]\d{0,}+|0(?:\.0)?)(?:\.(?:\d*[1-9]))?(?:[eE](?:0|\d{0,}[1-9])?)?$

I think.

That's a guess and with some testing.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]