Re: [PHP] Simple XML, (x)html, and xpath

2012-05-25 Thread Andrew Ballard
On Fri, May 25, 2012 at 3:57 AM, Gary wrote: > If I use simplexml_load_string to create an XML object with the > following XHTML > , > | > | | "http://www.w3.org/TR/ > | xhtml1/DTD/xhtml1-strict.dtd"> > | http://www.w3.org/1999/xhtml";> > | | /> > | test title > | > | > | > | > | > `--

Re: [PHP] Simple XML, (x)html, and xpath

2012-05-25 Thread ma...@behnke.biz
Gary hat am 25. Mai 2012 um 09:57 geschrieben: > If I use simplexml_load_string to create an XML object with the > following XHTML > , > | > | | "http://www.w3.org/TR/ > | xhtml1/DTD/xhtml1-strict.dtd"> > | http://www.w3.org/1999/xhtml";> > | | /> > | test title > | > | > | > | > |

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Richard Quadling
On 8 July 2010 18:55, Gary . wrote: > On 7/8/10, Marc Guay wrote: >>> And yes, I'd rather use DOM, but I can't. >> >> Could you use this: http://simplehtmldom.sourceforge.net/? > > Interesting. > > Although I can't use DOM or Tidy (because they're normally built in, > but TPTB decided to recompile

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Gary .
On 7/8/10, Marc Guay wrote: >> And yes, I'd rather use DOM, but I can't. > > Could you use this: http://simplehtmldom.sourceforge.net/? Interesting. Although I can't use DOM or Tidy (because they're normally built in, but TPTB decided to recompile PHP and exclude them, and I am not allowed to rec

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
> And yes, I'd rather use DOM, but I can't. Could you use this: http://simplehtmldom.sourceforge.net/? -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
> I wonder what the difference is between doing "new > SimpleXMLElement" and calling simplexml_load_string which results in the > libxml_use_internal_errors call being ineffective. Odd. The documentation for "Dealing with XML errors" only mentions simplexml_load_string() and this comment http://c

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Gary .
Marc Guay writes: >> libxml_use_internal_errors(true); >> $this->xml = new SimpleXMLElement($this->htmlString); > I have code that looks like this: > > libxml_use_internal_errors(true); > $xml = simplexml_load_string($val); Yeah. I tried simplexml_load_string and found that "worked" (in that it d

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Marc Guay
> libxml_use_internal_errors(true); > $this->xml = new SimpleXMLElement($this->htmlString); Hi Gary, I have code that looks like this: libxml_use_internal_errors(true); $xml = simplexml_load_string($val); $errors = libxml_get_errors(); if ($errors) do this else do that which wo

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Gary .
Richard Quadling writes: > On 8 July 2010 08:07, Gary wrote: >> Why am I still getting an exception when I do this: >> >> libxml_use_internal_errors(true); >> $this->xml = new SimpleXMLElement($this->htmlString); >> >> or this >> $this->xml = new SimpleXMLElement($this->htmlString, >> LIBXML_NOERRO

Re: [PHP] Simple XML - problem with errors

2010-07-08 Thread Richard Quadling
On 8 July 2010 08:07, Gary . wrote: > Why am I still getting an exception when I do this: > > libxml_use_internal_errors(true); > $this->xml = new SimpleXMLElement($this->htmlString); > > or this > $this->xml = new SimpleXMLElement($this->htmlString, > LIBXML_NOERROR|LIBXML_NOWARNING); > > ? > > T

[PHP] Simple XML - problem with errors

2010-07-08 Thread Gary .
Why am I still getting an exception when I do this: libxml_use_internal_errors(true); $this->xml = new SimpleXMLElement($this->htmlString); or this $this->xml = new SimpleXMLElement($this->htmlString, LIBXML_NOERROR|LIBXML_NOWARNING); ? The exception says "Exception: String could not be parsed

[PHP] simple xml object

2009-10-26 Thread Chris W
I have the following xmlwith standard tags changed to [ and ] to prevent mail clients from encoding it as html. [?xml version="1.0"?] [resultset errors="0" results="86"] [result id="20080922133104871678" lastinspected="9/29/2009 0:00"]0.4[/result] [result id="20080922133104871678" lastinspec

Re: [PHP] Simple XML in PHP

2009-03-24 Thread DredWerks
In this case "media" is a namespace, so is "live". The XML should have some lines above the ones you posted defining those namespaces. Try something like this: $simplexml = simplexml_load_string(...your entire xml...); $url0 = $simplexml->xpath( '//media:content' ); $url = $url0[0]->at

[PHP] Simple XML in PHP

2009-03-24 Thread Stephen Alistoun
HI all, How would a get this video from XML. /***Example i want to View***/ http://video-cdn.abcnews.com/090324_gma_leamy.flv"; lang="en" width="424" height="318" type="video/x-flv" /> /**/ /**XML CODE

[PHP] Simple XML array count??

2006-05-17 Thread Jay Paulson
I'm using SimpleXML to go through a Google search result and I'm not quite understanding something. The variable $xml->RES->R is an array of 9 items and each item is an object containing information (see var dump below). So when I try to do count($xml->RES->R); it returns a number or 1 instead a

Re: [PHP] Simple XML

2005-03-04 Thread Uroš Gruber
Jochem Maas wrote: Richard Lynch wrote: Uroš Gruber wrote: bar.com foo.com But I cant get to this "cd" If I print_r complete response object it out of interest what does print_r() actually output? better yet what does

Re: [PHP] Simple XML

2005-03-03 Thread Jochem Maas
Richard Lynch wrote: Uroš Gruber wrote: http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd"> And then bar.com foo.com But I cant get to this "cd" I

Re: [PHP] Simple XML

2005-03-03 Thread Richard Lynch
Uroš Gruber wrote: >xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; > xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 > epp-1.0.xsd"> > > And then > > > xsi:schemaLocation="urn:ietf:params:xml:ns:domain-1.0 domain-1.0.xsd"> > >

[PHP] Simple XML

2005-03-03 Thread UroÅ Gruber
Hello! I have trouble parsing some XML data. I'm doing EPP client http://www.iana.org/assignments/xml-registry/ns.html And responses I get uses XML shemas. Header of response is http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="urn:ietf:params:xml:ns:epp-1.0 epp-1.0.xsd

Re: [PHP] Simple XML

2004-11-12 Thread John Holmes
Octavian Rasnita wrote: Does anyone know if PHP has a library for getting the content of an XML file like XML::Simple in perl? In that perl library I can get the whole content of an XML file in a reference to an array of arrays of arrays... with only 3 lines of code. Is there such a simple method i

[PHP] Simple XML

2004-11-11 Thread Octavian Rasnita
Hi all, Does anyone know if PHP has a library for getting the content of an XML file like XML::Simple in perl? In that perl library I can get the whole content of an XML file in a reference to an array of arrays of arrays... with only 3 lines of code. Is there such a simple method in PHP? Thank