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

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

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"> > >

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