Skip Menu |

This queue is for tickets about the HTML-TreeBuilder-XPath CPAN distribution.

Report information
The Basics
Id: 81722
Status: open
Priority: 0/
Queue: HTML-TreeBuilder-XPath

People
Owner: Nobody in particular
Requestors: parlay [...] yopmail.com
Cc:
AdminCc:

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



Subject: attribute selector isn't case-insensitive
As initially reported in this ticket in the XML::XpathEngine queue: https://rt.cpan.org/Public/Bug/Display.html?id=81577 HTML::TreeBuilder::XPath lowers the case of the attributes in the html tree, but doesn't lower the case of the attribute in the query, so the only way to select by attribute is to always use the lower case version of the attribute name. This can be confusing, so either the attribute selector should alo be lowercased, or this behavior should be documented.
Subject: Re: [rt.cpan.org #81722] attribute selector isn't case-insensitive
Date: Wed, 05 Dec 2012 17:41:50 +0100
To: bug-HTML-TreeBuilder-XPath [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
On 12/05/2012 05:15 PM, parlay via RT wrote: Show quoted text
> Wed Dec 05 11:15:08 2012: Request 81722 was acted upon. > Transaction: Ticket created by parlay > Queue: HTML-TreeBuilder-XPath > Subject: attribute selector isn't case-insensitive > Broken in: (no value) > Severity: (no value) > Owner: Nobody > Requestors: parlay@yopmail.com > Status: new > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81722 > > > > As initially reported in this ticket in the XML::XpathEngine queue: > https://rt.cpan.org/Public/Bug/Display.html?id=81577 > > HTML::TreeBuilder::XPath lowers the case of the attributes in the html > tree, but doesn't lower the case of the attribute in the query, so the > only way to select by attribute is to always use the lower case version > of the attribute name. This can be confusing, so either the attribute > selector should alo be lowercased, or this behavior should be documented.
Actually I believe HTML::TreeBuilder does the lowercasing, so a doc patch for that module would be the proper fix. -- mirod
From: parlay [...] yopmail.com
On Wed Dec 05 11:42:17 2012, xmltwig@gmail.com wrote: Show quoted text
> On 12/05/2012 05:15 PM, parlay via RT wrote:
> > Wed Dec 05 11:15:08 2012: Request 81722 was acted upon.
Show quoted text
> Actually I believe HTML::TreeBuilder does the lowercasing, so a doc > patch for that module would be the proper fix.
So does that mean you don't think this is a problem and it shouldn't be fixed here? It took me forever to track down why my script using Web::Scraper wasn't working and even if it was documented in HTML::TreeBuilder, I doubt I would have figured out to look there.
Subject: Re: [rt.cpan.org #81722] attribute selector isn't case-insensitive
Date: Thu, 06 Dec 2012 17:48:27 +0100
To: bug-HTML-TreeBuilder-XPath [...] rt.cpan.org
From: mirod <xmltwig [...] gmail.com>
On 12/05/2012 11:25 PM, parlay via RT wrote: Show quoted text
> Queue: HTML-TreeBuilder-XPath > Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=81722 > > > On Wed Dec 05 11:42:17 2012, xmltwig@gmail.com wrote:
>> On 12/05/2012 05:15 PM, parlay via RT wrote:
>>> Wed Dec 05 11:15:08 2012: Request 81722 was acted upon.
>
>> Actually I believe HTML::TreeBuilder does the lowercasing, so a doc >> patch for that module would be the proper fix.
> > So does that mean you don't think this is a problem and it shouldn't be > fixed here? It took me forever to track down why my script using > Web::Scraper wasn't working and even if it was documented in > HTML::TreeBuilder, I doubt I would have figured out to look there.
Why would you not look in HTML::TreeBuilder? It's listed in HTML::TreeBuilder::XPath's manpage, in the "See Also" section. All HTML::TreeBuilder::XPath does is add a few methods to HTML::TreeBuilder, so most of the docs are there. if a query doesn't seem to get the results you want, it would also seem natural to dump the HTML to see how HTML::TreeBuilder::XPath sees it: perl -MHTML::TreeBuilder::XPath -E'say HTML::TreeBuilder::XPath->new_from_content( q{<html><head><meta Content="foo" Name="Description"/></head><body><p>bar</p>})->as_HTML' -- mirod