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