Subject: | problem with xs:decimal type in XML-Validator-Schema-1.08 |
XML-Validator-Schema-1.08
This make be wrong - I don't know much about XML. My problem is that a decial like .56 is invalid, it needs 0.56 to pass. This sort of output comes from modules like XML-Generator-DBI-1.00, which I think happens because DBI is returning a string (like .56).
I attached a test for the digits.yml test, and my suggested code patch to SimpleType.pm is below(only seem to be able to attach one patch)
87c87
< $BUILTIN{decimal}->restrict(pattern => qr/^[+-]?\d*(?:\.\d+)?$/);
---
Show quoted text
> $BUILTIN{decimal}->restrict(pattern => qr/^[+-]?\d+(?:\.\d+)?$/);
96,105d95
< --- |
< <dec>0.45</dec>
< --- >
< PASS
<
< --- |
< <dec>.45</dec>
< --- >
< PASS
<