Closed
Description
Symfony version(s) affected
5.4.0
Description
I´m using DomCrawler and CssSelector components to parse XML pages.
If the ID attribute of a tag has a colon char, the ID selector (#) fail to find the element.
How to reproduce
$xml = <<<XML
<?xml version="1.0" encoding="UTF-8"?>
<content>
<tag id="test">foo</tag>
<tag id="test:colon">bar</tag>
</content>
XML;
$crawler = new Crawler();
$crawler->addXmlContent($xml);
var_dump(
$crawler->filter('#test')->count(),
$crawler->filter('#test\:colon')->count() // notice the colon char is escaped
);
Possible Solution
No response
Additional Context
No response