Tag Archives: DOMDocument

The SimpleXMLElement Magic Wonder World in PHP

PHP’s Simplexml ships with a lot of magic to simplify access to an XML documents element and attribute node values. Some criticize this and suggest to use the DOM library instead. The DOM library on the other hand, even it … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed, The Know Your Language Department, Uncategorized | Tagged , , , , | Leave a comment

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 … Continue reading

Posted in Developing, Hakre's Tips, PHP Development, Pressed | Tagged , , , , | Leave a comment

SimpleXML Type Cheatsheet

A SimpleXMLElement can represent many different things, from an element, to a list of attributes or childelements. Sometimes it’s good to know how to find out, especially with the magic the extension comes with. The following is a table with … Continue reading

Posted in Hakre's Tips, PHP Development, Pressed, The Know Your Language Department | Tagged , , , , , , , , , | 1 Comment

Using Catalogs for Validation with PHP’s DOMDocument and Libxml2

DOMDocument schema and DTD validation in PHP can make use of libxml2’s Catalog support feature. A catalog is basically a XML file which contains information where to obtain the DTD and XSD schema from local disk. That is mapping a … Continue reading

Posted in Uncategorized | Tagged , , , , , , , , | 3 Comments

CSS Selector to XPath conversion

While playing with a parser experiment that fully supports the CSS selectors syntax and the discovery of the Selectors API I started to think about the transformation from CSS selectors to XPath. Sure I’m not the only one, so I … Continue reading

Posted in Developing, PHP Development, Pressed | Tagged , , , , , , , | 1 Comment