Skip Menu |

This queue is for tickets about the HTML-HTML5-Parser CPAN distribution.

Report information
The Basics
Id: 88468
Status: open
Priority: 0/
Queue: HTML-HTML5-Parser

People
Owner: Nobody in particular
Requestors: NGLENN [...] cpan.org
Cc:
AdminCc:

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



Subject: id should be of type ID
It would be very convenient if the following printed 1: use HTML::HTML5::Parser; my $parser = HTML::HTML5::Parser->new; my $doc = $parser->parse_string(<<'EOT'); <!doctype html> <html id="rootId"/> EOT my $root = $doc->getDocumentElement; my $id = $root->getAttributeNode('id'); print $id->isId; The problem I'm running into is XPath, where id('xyz') returns nothing. According to the XML::LibXML docs, this can be done either with a DTD or by parsing the string in the first place with the HTML parser. I wish LibXML had provided a "setIdAtts" method; a patch would be easy then.
It might be doable with a little XS. (I've written something similar to get line numbers working.)
That would be very fantastic! The isId is XS, in LibXML.xs line 6953.