Skip Menu |

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

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

People
Owner: Nobody in particular
Requestors: max [...] maxandmary.com
Cc:
AdminCc:

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



Subject: nillable attribute breaks templates (PATCH INCLUDED)
You get an error when you try to generate a template from a schema that has a nillable attribute on an element. In PERL this results in an empty (unnamed) attribute with a value of TEMPLATE-ERROR... and in XML it errors out and terminates. The issue turns out to be that the code builds a hashref and includes the value of $do-() which returns a hashref. Dereferencing the result solves the issue. I did not review the code to see if there are other instances of the same issue as this one patched fixed my issues. diff -ru lib/XML/Compile/Translate/Template.pm /usr/lib/perl5/site_perl/5.8.8/XML/Compile/Translate/Template.pm --- lib/XML/Compile/Translate/Template.pm 2010-05-10 09:20:24.000000000 -0400 +++ /usr/lib/perl5/site_perl/5.8.8/XML/Compile/Translate/Template.pm 2010-06-09 12:24:45.000000000 -0400 @@ -211,7 +211,7 @@ sub makeElementNillable { my ($self, $path, $ns, $childname, $do) = @_; - sub { +{occur => "$childname is nillable", $do->()} }; + sub { +{occur => "$childname is nillable", %{$do->()}} }; } sub makeElementAbstract
Subject: Re: [rt.cpan.org #58321] nillable attribute breaks templates (PATCH INCLUDED)
Date: Fri, 11 Jun 2010 10:19:05 +0200
To: Max Cohan via RT <bug-XML-Compile [...] rt.cpan.org>
From: Mark Overmeer <mark [...] overmeer.net>
* Max Cohan via RT (bug-XML-Compile@rt.cpan.org) [100610 22:24]: Show quoted text
> Thu Jun 10 18:24:57 2010: Request 58321 was acted upon. > Transaction: Ticket created by loof > Queue: XML-Compile > Subject: nillable attribute breaks templates (PATCH INCLUDED) > Broken in: 1.15 > > You get an error when you try to generate a template from a schema that > has a nillable attribute on an element.
Accidentally, I had discovered this problem myself as well. Some patch was already in for 1.16. But thank you anyway! -- Regards, MarkOv ------------------------------------------------------------------------ Mark Overmeer MSc MARKOV Solutions Mark@Overmeer.net solutions@overmeer.net http://Mark.Overmeer.net http://solutions.overmeer.net
got fixed in 1.16