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

Report information
The Basics
Id:
8137
Status:
resolved
Priority:
Low/Low
Queue:

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

BugTracker
Severity:
Important
Broken in:
3.15
Fixed in:
3.16



Subject: 3.15 with keep_encoding: _parse_start_tag fails parsing attributes
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
sorry typo: <tag att="value"> gives $gi='tag' and @atts=('att', 'value') (1 space after tagname) Gerald Sedrati-Dinet
[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
[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
[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 runs on Request Tracker, is sponsored by The Perl Foundation, and maintained by Best Practical Solutions.

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