Skip Menu |

This queue is for tickets about the XML-Compile CPAN distribution.

Report information
The Basics
Id: 63464
Status: resolved
Priority: 0/
Queue: XML-Compile

People
Owner: Nobody in particular
Requestors: misch [...] czechin.cz
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.19
Fixed in: (no value)



Subject: totalFracDigits still remains somewhere
XML::Compile::Translate (from current package XML::Compile 1.19) contains this code (line#518): if(defined $facets{totalDigits} && defined $facets{fractionDigits}) { my $td = delete $facets{totalDigits}; my $fd = delete $facets{fractionDigits}; $facets{totalFracDigits} = [$td, $fd]; # ^^^^^^^^^^^^^^^^^^^^ } When I have an XSD containing restriction with both totalDigits and fractionDigits, as in this example: <xs:restriction base="xs:decimal"> <xs:totalDigits value="13" /> <xs:fractionDigits value="2" /> </xs:restriction> XML::Compile::Translate turns these two facets into an "totalFracDigits" facet. But as there is no support for "totalFracDigits" facet in XML::Compile::Schema::BuiltInFacets, all I get is this exception when trying to use such XSD: error: facet totalFracDigits not implemented at prem1/mtbr#facet Probably if XML::Compile::Translate would not make this transformation of totalDigits + fractionDigits into totalFracDigits, everything would be OK?
Subject: Re: [rt.cpan.org #63464] totalFracDigits still remains somewhere
Date: Tue, 30 Nov 2010 16:01:14 +0100
To: "http://mimon-cz.blogspot.com/ via RT" <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <solutions [...] overmeer.net>
* http://mimon-cz.blogspot.com/ via RT (bug-XML-Compile@rt.cpan.org) [101130 12:57]: Show quoted text
> Tue Nov 30 07:56:46 2010: Request 63464 was acted upon. > Transaction: Ticket created by http://mimon-cz.blogspot.com/ > Queue: XML-Compile > Subject: totalFracDigits still remains somewhere > > When I have an XSD containing restriction with both totalDigits and > fractionDigits, as in this example: > > <xs:restriction base="xs:decimal"> > <xs:totalDigits value="13" /> > <xs:fractionDigits value="2" /> > </xs:restriction> > > error: facet totalFracDigits not implemented at prem1/mtbr#facet > > Probably if XML::Compile::Translate would not make this transformation > of totalDigits + fractionDigits into totalFracDigits, everything would > be OK?
Oops, missing. The facet does (re)formatting of the value to fulfil the restriction. If you apply two formattings after each other, the second will disturb the first. Therefore, when both restrictions are set, they should be handled at once. I have no idea whether the "fractionDigits" will work, because I have never tested it. I will prepare an extension to fix the lacking code asap. -- Thanks for the report, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
although missing from the changelog, this got fixed in 1.20 Thanks for the report.