Re: PHP file that reads and displays iGoogle gadgets Programming Web Development by RobotFX > DOMDocument Thanks, but like I said, I'm quite a noob. I'm curently reading the http://php.net/manual/en/simplexml.examples-basic.php and http://php.net/manual/en/domdocument.loadxml.php pages but it will probably take me weeks until I'll understand how to do this. Can you please give me an example or write that page for me? Thanks a lot! DOMDocument Programming Web Development by Dani … code looks like this: if (!empty($foo)) { $doc = new DOMDocument(); $doc->loadHTML($foo); $images = $doc->getElementsByTagName('img');… } And this is happening: DOMDocument::loadHTML() [<a href='domdocument.loadhtml'>domdocument.loadhtml</a>]: Document is empty… Re: DOMDocument Programming Web Development by pritaeas `$foo` is an empty string or has invalid markup. See the second comment (by Shane Harter) [here](http://php.net/manual/en/domdocument.loadhtml.php). DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab ….php libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING);….php libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING);… Re: DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…errors.php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … Re: DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…errors.php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … Re: DomDocument Parser Best Practice Questions Programming Web Development by Dani …; Is simplexml_load_string() an Xml File Parser just like simple_html_dom() and domdocument() are html parsers ? Out of the latter two, which one… one over the other ? Kinda, yeah. Instead of creating a DOMDocument it creates a SimpleXML element. I don't personally have… Re: DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab …quot;; $xml = simplexml_load_file($initial_url); $dom = new DOMDocument(); $dom->loadXML($xml->asXML()); echo __LINE__ …scrape_page_data($html_page_url) { $html = file_get_contents($html_page_url); $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html, LIBXML_COMPACT | LIBXML_NOERROR |… Re: DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab @reverend_jim Do you use simple_html_dom() or domdocument() for html parsing ? Re: DomDocument Parser Best Practice Questions Programming Web Development by borobhaisab @pritaeas Is simplexml_load_string() an Xml File Parser just like simple_html_dom() and domdocument() are html parsers ? Out of the latter two, which one you prefer and why that one over the other ? Thank you DOMDocument::loadXML() [function.DOMDocument-loadXML]: Extra content Programming Web Development by abhijith Hi All, Why am getting this error " DOMDocument::loadXML() [function.DOMDocument-loadXML]: Extra content at the end of the document in Entity " :!: Please advise me . It is killing me a lot so plz reply :( DOMDocument save function not saving Programming Web Development by Venom Rush Hi all I'm creating XML with php's native DOMDocument functionality. When I try save the XML it doesn't … why. [CODE=php]<?php // Initiate the XML $doc = new DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; // Code that… DOMDocument saving < and > as &lt; and &gt; Programming Web Development by Venom Rush … entities but when I create and save the file with DOMDocument the < and > characters are converted to &lt…. Example of my code below: // Initiate the XML $doc = new DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $r = $doc… Re: DOMDocument saving < and > as &lt; and &gt; Programming Web Development by pritaeas You are inserting a text node. DOMDocument has a specific function to create a CDATA section: http://php.net/manual/en/domdocument.createcdatasection.php Re: DOMDocument save function not saving Programming Web Development by n_e … were written [code] <?php // Initiate the XML $doc = new DOMDocument('1.0', 'UTF-8'); $doc->formatOutput = true; $root = $doc… DOMDocument HTML parsing Programming Web Development by Buppy Hi, I want to parse all <iframe> tags with DOMDocument: $videos = $doc->getElementsByTagName('iframe'); echo $videos->item(0)->nodeValue; Unfortunately, thin only gets me the value between the opening and closing tag. How to display a full tag with all attrbutes and values with this method? Thanks Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…errors.php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR…php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta');… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…errors.php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…errors.php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab Folks, Using DomDocument, I am trying to build a crawler that, when I… I stick to this line or above line ? $dom = new DOMDocument(); $dom->loadXML($xml); if ($dom->nodeName === 'sitemapindex') { //… } } ```` Now, how to write code to extract meta tags using DomDocument ? Where can I find the code here ? https://www.php… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab @dani Can you show me the DomDocument links where you got the following meta tags… the DOM and load that baby up $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING…one (where you got the code: $doc = new DOMDocument()), but I need the links to the other 2. So… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by Dani …libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|….php libxml_clear_errors(); // https://www.php.net/manual/en/domdocument.getelementsbytagname.php $meta_tags = $doc->getElementsByTagName('meta'); … Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …file_get_contents($url); //https://www.php.net/manual/en/domdocument.construct.php $doc = new DOMDocument(); // https://www.php.net/manual/en/function.…errors.php libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING); //… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …file_get_contents($url); //https://www.php.net/manual/en/domdocument.construct.php $doc = new DOMDocument(); // https://www.php.net/manual/en/function.…errors.php libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING); //… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab …file_get_contents($url); //https://www.php.net/manual/en/domdocument.construct.php $doc = new DOMDocument(); // https://www.php.net/manual/en/function.…errors.php libxml_use_internal_errors(true); // https://www.php.net/manual/en/domdocument.loadhtml.php $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING); //… Cannot clone object of class DOMDocument due to 'zend.ze1_compatibility_mode' Programming Web Development by toXXXic … what I am trying: [ICODE]<?php $doc = new DOMDocument(); $doc2 = new DOMDocument(); $bbcLink='http://newsrss.bbc.co.uk/rss/newsonline_uk_edition/world…] Now, I get an error Cannot clone object of class DOMDocument due to 'zend.ze1_compatibility_mode'. I did change the value of… PHP DOMDocument not working Programming Web Development by sugumarclick ….6.23 libXML streams enabled But still I cannot use DOMDocument in my script. When I use it in my script…, Class 'DOMDocument' not found in /var/www/html/getcontent_3.php Any pointers… equilent is available in php and its performance comparing to DOMDocument. Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by Dani … using DomDocu & simple html dom parsers ? I would use DomDocument as it's built into PHP. However, in your code… manipulate the DOM and load that baby up $doc = new DOMDocument(); libxml_use_internal_errors(true); $doc->loadHTML($html, LIBXML_COMPACT|LIBXML_NOERROR|LIBXML_NOWARNING); libxml_clear_errors… Re: How To Extract Meta Tags Using DomDocument ? Programming Web Development by borobhaisab @dani Why I coming across programmers who prefer to DomDocument over simple_html_fom ? What is the pros & cons of both ?