PHP: XPath on HTML and XHTML

Christan Weiske has published a nice summarizing article with the same title. It contains some detailed information I haven’t found so far on the web so worth the link: PHP: XPath on HTML and XHTML.

It also reminds me of some of the inaccuracies I still have in my earlier post on converting CSS Selectors to XPath, namely that casing is dependent to whether you use HTML or XML with DOMDocument in PHP. And also Weiske focuses on namespaces and suggests to use the self::-Axis instead of local-name() for matching the element(s) which I have not considered so far in the expressions.

This entry was posted in Developing, Hakre's Tips, PHP Development, Pressed and tagged , , , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.