Skip Menu |
 

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

Report information
The Basics
Id: 78956
Status: resolved
Worked: 5 min
Priority: 0/
Queue: XML-Pastor

People
Owner: aulusoy [...] cpan.org
Requestors: karlwb [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Normal
Broken in: 1.0.3
Fixed in: (no value)



Download (untitled) / with headers
text/plain 1.4k
XML-Pastor 1.0.3 Perl 5.12.4 on linux 2.6.32-279.1.1.el6.x86_64 (Centos 6.2). When using xml_validate() or is_xml_valid() methods against various schemas and both valid and invalid test xml docs, I consistently receive the following error: Can't call method "whiteSpace" on an undefined value at /usr/local/perl/lib/site_perl/5.12.4/XML/Pastor/SimpleType.pm line 179. Adding a defined check on $type on line SimpleType.pm line 179 partially fixes the problem, but occasionally leads to the following error: Can't locate object method "xml_validate_further" via package "XML::Pastor::Type" at /usr/local/perl/lib/site_perl/5.12.4/XML/Pastor/Type.pm line 374. The xml_validate_further sub in Type.pm is misspelled xml_validate_futher. A workaround is: --- SimpleType-1.0.3.pm 2008-08-02 03:59:26.000000000 -0500 +++ SimpleType.pm 2012-08-14 09:39:26.728389453 -0500 @@ -176,7 +176,7 @@ my $value = shift; my $type = $self->XmlSchemaType(); - if (defined(my $prop = $type->whiteSpace)) { + if (defined $type and defined(my $prop = $type->whiteSpace)) { $prop = (reftype($prop) eq 'ARRAY') ? $prop : [$prop]; foreach my $ws (@$prop) { if ($ws =~ /^replace$/i) { --- Type-1.0.3.pm 2008-08-02 03:42:57.000000000 -0500 +++ Type.pm 2012-08-14 09:37:44.852404159 -0500 @@ -377,7 +377,7 @@ } #---------------------------------------------- -sub xml_validate_futher { +sub xml_validate_further { return 1; # to be overriden! }
Subject: validate.patch
Download validate.patch
text/x-diff 717b
--- SimpleType-1.0.3.pm 2008-08-02 03:59:26.000000000 -0500 +++ SimpleType.pm 2012-08-14 09:39:26.728389453 -0500 @@ -176,7 +176,7 @@ my $value = shift; my $type = $self->XmlSchemaType(); - if (defined(my $prop = $type->whiteSpace)) { + if (defined $type and defined(my $prop = $type->whiteSpace)) { $prop = (reftype($prop) eq 'ARRAY') ? $prop : [$prop]; foreach my $ws (@$prop) { if ($ws =~ /^replace$/i) { --- Type-1.0.3.pm 2008-08-02 03:42:57.000000000 -0500 +++ Type.pm 2012-08-14 09:37:44.852404159 -0500 @@ -377,7 +377,7 @@ } #---------------------------------------------- -sub xml_validate_futher { +sub xml_validate_further { return 1; # to be overriden! }
Subject: Embarrassing really
Thanks you for the report. This is now fixed the same was as in the patch.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.