Skip Menu |

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

Report information
The Basics
Id: 119130
Status: new
Priority: 0/
Queue: XML-Pastor

People
Owner: Nobody in particular
Requestors: mark.solinski [...] gpsinsight.com
Cc:
AdminCc:

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



Subject: XML::Pastor::Type xml_validate passes @_ after shifting away all values
Date: Mon, 5 Dec 2016 20:23:34 +0000
To: "bug-XML-Pastor [...] rt.cpan.org" <bug-XML-Pastor [...] rt.cpan.org>
From: Mark Solinski <mark.solinski [...] gpsinsight.com>
Most error messages returned from inside xml_validate cannot identify the correct $path (always empty) because of the last lines of the subroutine: return ( $self->xml_validate_value(@_) && $self->xml_validate_further(@_) && $self->xml_validate_ancestors(@_)); are called after the $path is shifted off of @_. If the @_ is replaced with $path like this: return ( $self->xml_validate_value($path) && $self->xml_validate_further($path) && $self->xml_validate_ancestors($path)); Then the correct behavior is observed. For example, in a nested XML schema, I was receiving an error message like this: Pastor : Validate : : Length must be maximum '4' for value 'ABCDE' at C:/Strawberry/perl/site/lib/XML/Pastor/SimpleType.pm line 52. After making the change, I am now receiving the expected error message: Pastor : Validate : RemoteObdCollection/Payloads/Payload/VendorID : Length must be maximum '4' for value 'ABCDE' at C:/Strawberry/perl/site/lib/XML/Pastor/SimpleType.pm line 52.
Subject: [rt.cpan.org #119130] XML::Pastor::Type xml_validate passes @_ after shifting away all values
Date: Mon, 12 Dec 2016 20:40:26 +0000
To: "bug-XML-Pastor [...] rt.cpan.org" <bug-XML-Pastor [...] rt.cpan.org>
From: Mark Solinski <mark.solinski [...] gpsinsight.com>
Actually, a better replacement for: return ( $self->xml_validate_value(@_) && $self->xml_validate_further(@_) && $self->xml_validate_ancestors(@_)); are called after the $path is shifted off of @_. If the following changes are made: return ( $self->xml_validate_value($path, @_) && $self->xml_validate_further($path, @_) && $self->xml_validate_ancestors($path, @_)); Then the correct behavior is still observed AND the remaining parameters in @_ are not lost. I have never send more parameters passed in but how knows if someone will subclass XML::Pastor::Type.