Skip Menu |

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

Report information
The Basics
Id: 18479
Status: resolved
Priority: 0/
Queue: XML-XSLT

People
Owner: jns [...] gellyfish.co.uk
Requestors: jdhedden [...] cpan.org
Cc:
AdminCc:

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



Subject: //elem[n] bug and no test
In XSLT.pm, in "sub __try_a_step__", the case for //elem[n] appears to be wrong. elsif ( $path =~ s/^\/descendant\-or\-self\:\:node\(\)\/(child\:\:|)(\*|[\w\.\:\-]+)\[(\S+?)\]// ) { # //elem[n] # $self->debug(qq{getting deep indexed element `$1' `$2' ("$path")}); $self->_outdent(); return &__indexed_element__( $self, $1, $2, $path, $node, $silent, "deep" ); The regex has 3 matches. In all other cases, the match for (child::) is ignored. Here it is not, and the 3rd match (the index) is ignored. I believe the correct code should be to use $2 and $3 (not $1 and $2). When I test the original code, the test suite shows no errors. When I change the code and test it again, the test suite once more shows no errors. Therefore, this code is not tested in the test suite.
On Fri Mar 31 10:19:37 2006, JDHEDDEN wrote: Show quoted text
> In XSLT.pm, in "sub __try_a_step__", the case for //elem[n] appears to > be wrong. > > elsif ( $path =~ > s/^\/descendant\-or\-self\:\:node\(\)\/(child\:\:|)(\*|[\w\.\:\- > ]+)\[(\S+?)\]// > ) > { > # //elem[n] # > $self->debug(qq{getting deep indexed element `$1' `$2' > ("$path")}); > $self->_outdent(); > return &__indexed_element__( $self, $1, $2, $path, $node, $silent, > "deep" ); > > The regex has 3 matches. In all other cases, the match for (child::) > is > ignored. Here it is not, and the 3rd match (the index) is ignored. I > believe the correct code should be to use $2 and $3 (not $1 and $2). > > When I test the original code, the test suite shows no errors. When I > change the code and test it again, the test suite once more shows no > errors. Therefore, this code is not tested in the test suite.
Hi, can you try the latest version at https://github.com/jonathanstowe/XML-XSLT to see if it still does it? A failing test would be really nice thanks.
Going to close this as I believe it is fixed and no feedback