Skip Menu |
 

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

Report information
The Basics
Id: 8137
Status: resolved
Priority: 0/
Queue: XML-Twig

People
Owner: MIROD [...] cpan.org
Requestors: sedrati [...] bigfoot.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 3.15
Fixed in: 3.16



Subject: 3.15 with keep_encoding: _parse_start_tag fails parsing attributes
Download (untitled) / with headers
text/plain 599b
Hi, I've found that in latest stable version (3.15, pervious version I've successfully tested was 3.09), the attributes of a node were deleted when keep_encoding option is set and there were several space characters between tag name and first attribute. Ex: <tag att="value"> gives $gi='tag' and @atts=() (2 spaces after tagname) whereas <tag att="value"> gives $gi='tag' and @atts=() (1 space after tagname) The suspected "bug" is line 1345 of Twig.pm : if( $string=~ s{^<\s*($REG_NAME)[\s>/]}{}s) should be if( $string=~ s{^<\s*($REG_NAME)(?:\s*|[>/])}{}s) Hope it helps Gerald Sedrati-Dinet
From: sedrati [...] bigfoot.com
Download (untitled) / with headers
text/plain 121b
sorry typo: <tag att="value"> gives $gi='tag' and @atts=('att', 'value') (1 space after tagname) Gerald Sedrati-Dinet
Download (untitled) / with headers
text/plain 776b
[guest - Wed Oct 27 06:07:59 2004]: Show quoted text
> Hi, > > I've found that in latest stable version (3.15, pervious version I've > successfully tested was 3.09), the attributes of a node were > deleted when keep_encoding option is set and there were several > space characters between tag name and first attribute. > > Ex: > <tag att="value"> gives $gi='tag' and @atts=() (2 spaces after > tagname) > whereas > <tag att="value"> gives $gi='tag' and @atts=() (1 space after tagname) > > The suspected "bug" is line 1345 of Twig.pm : > if( $string=~ s{^<\s*($REG_NAME)[\s>/]}{}s) > should be > if( $string=~ s{^<\s*($REG_NAME)(?:\s*|[>/])}{}s)
I will test this tonight and if it works update a new development version probably tomorrow Show quoted text
> Hope it helps
It does! Thanks
Download (untitled) / with headers
text/plain 393b
[guest - Wed Oct 27 11:33:33 2004]: Show quoted text
> > The suspected "bug" is line 1345 of Twig.pm : > > if( $string=~ s{^<\s*($REG_NAME)[\s>/]}{}s) > > should be > > if( $string=~ s{^<\s*($REG_NAME)(?:\s*|[>/])}{}s)
I ended up fixing the bug by doing if( $string=~ s{^<\s*($REG_NAME)\s*[\s>/]}{}s) The updated version is at http://xmltwig.com/xmltwig/ let me know if if works for you. Thanks __ Mirod
From: sedrati [...] bigfoot.com
Download (untitled) / with headers
text/plain 481b
[MIROD - Thu Oct 28 11:25:30 2004]: Show quoted text
> [guest - Wed Oct 27 11:33:33 2004]: >
> > > The suspected "bug" is line 1345 of Twig.pm : > > > if( $string=~ s{^<\s*($REG_NAME)[\s>/]}{}s) > > > should be > > > if( $string=~ s{^<\s*($REG_NAME)(?:\s*|[>/])}{}s)
> > I ended up fixing the bug by doing > if( $string=~ s{^<\s*($REG_NAME)\s*[\s>/]}{}s) > > The updated version is at http://xmltwig.com/xmltwig/ let me know if > if works for you. > > Thanks > > __ > Mirod
That's fine, thx


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.