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.