Top "Domdocument" questions

DOMDocument refers to a class encapsulating the DOM (Document Object Model).

How to get full HTML from DOMXPath::query() method?

I have document from which I want to extract specific div with it's untouched content. I do: $dom = new DOMDocument(); $…

php domdocument
DOMElement cloning and appending: 'Wrong Document Error'

There's something I don't fully understand about node cloning with the PHP's DOM api. Here's a sample file that quickly …

php xml dom domdocument
How do I tell DOMDocument->load() what encoding I want it to use?

I search for and process XML files from elsewhere, and need to transform them with some XSLTs. No problem. Using …

php xml dom domdocument
How to remove an HTML element using the DOMDocument class

Is there a way to remove a HTML element by using the DOMDocument class?

php domdocument
PHP DOMDocument getElementsByTagname?

This is driving me bonkers... I just want to add another img node. $xml = <<<XML <?xml …

php dom domdocument
PHP DomDocument output without <?xml version="1.0" encoding="UTF-8"?>

is there an option with DomDocument to remove the first line: <?xml version="1.0" encoding="UTF-8"?> The class instantiation …

php domdocument
Fix malformed XML in PHP before processing using DOMDocument functions

I'm needing to load an XML document into PHP that comes from an external source. The XML does not declare …

php xml domdocument
DOMDocument in php

I have just started reading documentation and examples about DOM, in order to crawl and parse the document. For example …

php xml-parsing html-parsing domdocument
PHP Warning: DOMDocument::load(): I/O warning : failed to load external entity

I read everything I could about this error without being able to find any solution. I have a simple page …

php xml domdocument
DomDocument and special characters

This is my code: $oDom = new DOMDocument(); $oDom->loadHTML("èàéìòù"); echo $oDom->saveHTML(); This is the output: <!DOCTYPE …

php utf-8 domdocument