Re: [PHP] SimpleXML and the Single String (SOLVED)

2012-02-22 Thread ma...@behnke.biz
There is another nice way. You can pass a second value to the simple xml constructor which is a class name to be used instead of SimpleXMLElement. You can write your own class that extends SimpleXMLElement and override the magic methods to skip the casting Simon Schick

Re: [PHP] SimpleXML and the Single String (SOLVED)

2012-02-22 Thread Jay Blanchard
On 2/22/2012 8:32 AM, ma...@behnke.biz wrote: There is another nice way. You can pass a second value to the simple xml constructor which is a class name to be used instead of SimpleXMLElement. You can write your own class that extends SimpleXMLElement and override the magic methods to skip the

Re: [PHP] SimpleXML and the Single String (SOLVED)

2012-02-22 Thread Marco Behnke
Am 22.02.12 16:04, schrieb Jay Blanchard: On 2/22/2012 8:32 AM, ma...@behnke.biz wrote: There is another nice way. You can pass a second value to the simple xml constructor which is a class name to be used instead of SimpleXMLElement. You can write your own class that extends

Re: [PHP] SimpleXML and the Single String (SOLVED)

2012-02-22 Thread Jay Blanchard
I don't really see a need to add an extra layer or class extension when casting works fine. Am I wrong? Why add several lines of code in an extension class? To keep the code readable? $value = $xml-node; vs. $value = (String)$xml-node; I like the first one. Plus you handle it to

Re: [PHP] SimpleXML and the Single String (SOLVED)

2012-02-21 Thread Simon Schick
Hi, Jay If you're not using the variable *$xmlCompany* somewhere else I'd try to skip the array and just do it with this single line: *$arrayLead[0]-Company = (string) $xml-SignonRq-SignonTransport-CustId-SPName;* The result should not differ from what you have now. Bye Simon 2012/2/21 Jay

[PHP] SimpleXML and the Single String (SOLVED)

2012-02-20 Thread Jay Blanchard
Howdy, My PHP chops are a little rough around the edges so I know that I am missing something. I am working with SimpleXML to retrieve values from an XML file like this - $xmlCompany = $xml-SignonRq-SignonTransport-CustId-SPName; If I echo $xmlCompany I get the proper information. If I use

[PHP] SimpleXML - parsing attributes with a namespace

2011-06-03 Thread Anthony Gladdish
Hi, Using following code does not parse the xml:id attribute. If I change the attribute's namespace to anything other than xml ( e.g. new:id ) then it works. $string = XML TEI xml:id=decten1tlsg01 teiHeader profileDesc particDesc person xml:id=interviewerTlsg01 /person /particDesc

[PHP] SimpleXML - parsing attributes with a namespace

2011-06-03 Thread Anthony Gladdish
Hi, Using following code does not parse the xml:id attribute. If I change the attribute's namespace to anything other than xml ( e.g. new:id ) then it works. $string = XML TEI xml:id=decten1tlsg01 teiHeader profileDesc particDesc person xml:id=interviewerTlsg01 /person /particDesc

[PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Brian Dunning
I am kind of jacked here. I have a SimpleXML object that's been converted to an array. In one of the nodes, for no reason I can see, the array is populated differently if there is only one order_item than if there are multiple order_items. If there is just one, my $order_item array looks like

Re: [PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Nathan Nobbe
On Tue, Sep 28, 2010 at 4:29 PM, Brian Dunning br...@briandunning.comwrote: I am kind of jacked here. I have a SimpleXML object that's been converted to an array. how was the SimpleXMLElement converted to an array? -nathan

Re: [PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Brian Dunning
If you read down to the bottom of the post, the function I used is given. On Sep 28, 2010, at 3:47 PM, Nathan Nobbe wrote: On Tue, Sep 28, 2010 at 4:29 PM, Brian Dunning br...@briandunning.com wrote: I am kind of jacked here. I have a SimpleXML object that's been converted to an array.

Re: [PHP] SimpleXML/array duality (like particles waves)

2010-09-28 Thread Nathan Nobbe
On Tue, Sep 28, 2010 at 5:06 PM, Brian Dunning br...@briandunning.comwrote: If you read down to the bottom of the post, the function I used is given. My apologies for the hasty response. well, if i had to guess, id say thats where the problem is. why cant you just iterate over the object w/

[PHP] simpleXML - can't add children - why? - stuck

2010-08-04 Thread MEM
Hello all, I'm struggling here, but no joy so far. Having this XML file that I'm loading using simplexml_load_file(): http://pastebin.com/JiW3LxWM I need to add some domain:create children nodes after line 8. What do I need to add? This: http://pastebin.com/mT27g3ZN In order to do so, I have

Re: [PHP] simplexml choking on apparently valid XML - Solved

2010-05-10 Thread Brian Dunning
I was able to resolve this by changing the XML file encoding from UTF-8 to ISO-8859-1. Works like a charm now, with the XML-encoded characters. Thanks to all who offered their help. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP] simplexml choking on apparently valid XML

2010-05-08 Thread Deva
I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: Hey all - I'm using simplexml-load-string just to validation a string of XML, and

Re: [PHP] simplexml choking on apparently valid XML

2010-05-08 Thread Deva
- amp; added space because browser is converting it to :) On 5/8/10, Deva devendra...@gmail.com wrote: I think that should be amp; because you cant use in xml as independent alphbet On 5/7/10, Dan Joseph dmjos...@gmail.com wrote: On Thu, May 6, 2010 at 8:02 PM, Brian Dunning

Re: [PHP] simplexml choking on apparently valid XML

2010-05-08 Thread Peter Lind
On 8 May 2010 00:39, Nathan Nobbe quickshif...@gmail.com wrote: hmm, both the strings seem to work fine on my laptop: +1. Have no problem with either string -- hype WWW: http://plphp.dk / http://plind.dk LinkedIn: http://www.linkedin.com/in/plind Flickr: http://www.flickr.com/photos/fake51

Re: [PHP] simplexml choking on apparently valid XML

2010-05-07 Thread Brian Dunning
This time simplexml-load-string also gave me the same error on the following line: first_nameCharlie amp; Brady/first_name Can anyone confirm whether simplexml-load-string will or will not accept or allow XML-encoded characters? It seems that it should and would be pretty surprising if it

Re: [PHP] simplexml choking on apparently valid XML

2010-05-07 Thread Nathan Nobbe
On Fri, May 7, 2010 at 4:32 PM, Brian Dunning br...@briandunning.comwrote: This time simplexml-load-string also gave me the same error on the following line: first_nameCharlie amp; Brady/first_name Can anyone confirm whether simplexml-load-string will or will not accept or allow

[PHP] simplexml choking on apparently valid XML

2010-05-06 Thread Brian Dunning
Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML: client_orderitem_numberBasketball Personalized Notebook - Jeffapos;s/client_orderitem_number

Re: [PHP] simplexml choking on apparently valid XML

2010-05-06 Thread Dan Joseph
On Thu, May 6, 2010 at 8:02 PM, Brian Dunning br...@briandunning.comwrote: Hey all - I'm using simplexml-load-string just to validation a string of XML, and libxml-get-errors to return any errors. It's always worked before, but today it's choking on this line in the XML:

[PHP] SimpleXML: convert xml to text

2010-03-14 Thread Dasn
Hello, I want to convert some xml stuff to simple string using php, say: ?php $string = XML a left foocenter1okok/okcenter2/fooright /a XML; $xml = simplexml_load_string($string); echo $xml; ? The code will output left right while all the central stuff was lost. How should I print it as left

Re: [PHP] SimpleXML: convert xml to text

2010-03-14 Thread Ashley Sheridan
On Sun, 2010-03-14 at 21:58 +0800, Dasn wrote: Hello, I want to convert some xml stuff to simple string using php, say: ?php $string = XML a left foocenter1okok/okcenter2/fooright /a XML; $xml = simplexml_load_string($string); echo $xml; ? The code will output left right while all

Re: [PHP] SimpleXML: convert xml to text

2010-03-14 Thread Dasn
On Sun, 14 Mar 2010 22:02:22 +0800, Ashley Sheridan wrote: On Sun, 2010-03-14 at 21:58 +0800, Dasn wrote: Hello, I want to convert some xml stuff to simple string using php, say: ?php $string = XML a left foocenter1okok/okcenter2/fooright /a XML; $xml = simplexml_load_string($string); echo

Re: [PHP] SimpleXML: convert xml to text

2010-03-14 Thread Dasn
On Sun, 14 Mar 2010 22:02:22 +0800, Ashley Sheridan wrote: On Sun, 2010-03-14 at 21:58 +0800, Dasn wrote: Hello, I want to convert some xml stuff to simple string using php, say: ?php $string = XML a left foocenter1okok/okcenter2/fooright /a XML; $xml = simplexml_load_string($string); echo

Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread Ashley Sheridan
On Sun, 2010-02-07 at 23:24 -0800, TerryA wrote: Hi Carlos I looked at the documentation for hours but don't see any solution. I'm uploading a sample file here. The full file contains around 100 properties but the uploaded file has just one. I need to extract data from this file to write

Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread TerryA
Hi Guys Thanks for all your input. This forum is great! I can get the attributes OK but I can't code the checking routing correctly. This is what I have: Many thanks again for your input. I tried this but it only gives me the data for each element. I need to be able to access the attributes of

Re: [PHP] simplexml - can it do what I need?

2010-02-08 Thread TerryA
Got it! I corrected my syntax and this code now works as far as I can tell: ?php $file= 'annnonces.xml'; // load file $xml = simplexml_load_file($file) or die (Unable to load XML file!); foreach ($xml-xpath('//lot') as $lot) { echo $lot-numero_lot, 'type ', $lot-type, $lot-identification,

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread TerryA
Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by attributes. I need

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread Carlos Medina
TerryA schrieb: Hi Shawn Thanks for answering my query. I have looked at the suggestions: $xml = simplexml_load_file('file.xml', 'SimpleXMLElement', LIBXML_NOCDATA); I am/was able to load the file OK and to access the data by iteration. However, I can't find a way to extract data by

Re: [PHP] simplexml - can it do what I need?

2010-02-07 Thread TerryA
Hi Carlos I looked at the documentation for hours but don't see any solution. I'm uploading a sample file here. The full file contains around 100 properties but the uploaded file has just one. I need to extract data from this file to write to a MySQL database. I have no problem in doing this

Re: [PHP] simplexml - can it do what I need?

2010-02-06 Thread Shawn McKenzie
TerryA wrote: My first post and I'm just a few days into learning PHP so that I can extract data from an XML feed for updating a MySQL driven website. Simplexml grabs most of my data without a problem but I can't get at the data in elements such as: element idtype=11 lang=fr

[PHP] SimpleXML or DOMDocument help

2009-12-09 Thread Michael Alaimo
Hello All, I have an XML document that has elements as such: Query:Expression Query:ResourceID Query:EqualTest/Query:Equal /Query:ResourceID /Query:Expression I cannot figure out how to access these with simple xml. I am not opposed to a

[PHP] SimpleXML var_dump() weirdness

2009-10-13 Thread Mattias Thorslund
Hi, It seems that var_dump() of a SimpleXMLElement does not show an attribute of elements that contain text content? I hope my examples might show what I mean: $xml = 'root rootattr=root valueinner attr=value//root'; $simple = new SimpleXMLElement($xml); var_dump($simple); echo

[PHP] SimpleXML Class

2009-05-06 Thread Cesco
Could you help me clarify one thing that I don't understand... let's put it simple, just imagine that I have a tiny XML document with a list of movies: movies title iGone/i with bthe/b wind /title /movies I want to read this XML file and write the name of the

[PHP] SimpleXML output encoding

2009-05-05 Thread Ondrej Kulaty
Hi, is there any way how to set output encoding for SimpleXML? It will load XML document in any encoding, but internally, it converts the document to UTF-8 and outputs it in this encoding. I would like to have output encoding set to ISO-8859-2, is it possible? thanks. -- Ondrej Kulaty --

Re: [PHP] SimpleXML output encoding

2009-05-05 Thread tedd
At 2:40 PM +0200 5/5/09, Ondrej Kulaty wrote: Hi, is there any way how to set output encoding for SimpleXML? It will load XML document in any encoding, but internally, it converts the document to UTF-8 and outputs it in this encoding. I would like to have output encoding set to ISO-8859-2, is it

Re: [PHP] SimpleXML output encoding

2009-05-05 Thread Ondrej Kulaty
Because i am working on an old system which is in ISO, i cant use unicode. -- Ondrej Kulaty tedd tedd.sperl...@gmail.com píse v diskusním príspevku news:p06240802c625f6b4e...@[192.168.1.101]... At 2:40 PM +0200 5/5/09, Ondrej Kulaty wrote: Hi, is there any way how to set output encoding for

Re: [PHP] problem with PHP simplexml and doxygen generated XML

2009-04-05 Thread hessiess
On Apr 3, 2009, at 17:52, hessi...@hessiess.com wrote: I have bean trying to right a PHP script to generate XHTML code from the class documentation xml files created by Doxygen(the HTML it outputs is invalid, messy and virtually imposable to integrate into another web page). One thing

Re: [PHP] problem with PHP simplexml and doxygen generated XML

2009-04-05 Thread Andrew Williams
I HAVE THE SAME PROBLEM, PLEASE HOW HAVE YOU DONE IT On Sun, Apr 5, 2009 at 4:08 PM, hessi...@hessiess.com wrote: On Apr 3, 2009, at 17:52, hessi...@hessiess.com wrote: I have bean trying to right a PHP script to generate XHTML code from the class documentation xml files created by

Re: [PHP] problem with PHP simplexml and doxygen generated XML

2009-04-05 Thread hessiess
I HAVE THE SAME PROBLEM, PLEASE HOW HAVE YOU DONE IT On Sun, Apr 5, 2009 at 4:08 PM, hessi...@hessiess.com wrote: On Apr 3, 2009, at 17:52, hessi...@hessiess.com wrote: I have bean trying to right a PHP script to generate XHTML code from the class documentation xml files created

[PHP] problem with PHP simplexml and doxygen generated XML

2009-04-03 Thread hessiess
I have bean trying to right a PHP script to generate XHTML code from the class documentation xml files created by Doxygen(the HTML it outputs is invalid, messy and virtually imposable to integrate into another web page). One thing has bean causing problems, the tags which start with `@', for

Re: [PHP] problem with PHP simplexml and doxygen generated XML

2009-04-03 Thread Phpster
On Apr 3, 2009, at 17:52, hessi...@hessiess.com wrote: I have bean trying to right a PHP script to generate XHTML code from the class documentation xml files created by Doxygen(the HTML it outputs is invalid, messy and virtually imposable to integrate into another web page). One thing has

[PHP] SimpleXML

2009-02-24 Thread Alex Chamberlain
Hi, I am trying to write a PHP interface to ISBNdb.com. When I make a certain request, the following is returned ISBNdb server_time=2009-02-24T18:57:31Z BookList total_results=1 page_size=10 page_number=1 shown_results=1 BookData book_id=language_proof_and_logic isbn=157586374X

[PHP] SimpleXML - issue with getting data out of the object returned

2008-12-18 Thread Dan Joseph
Hi, I have a basic XML document that I am grabbing with simplexml_load_string(), here is the print_r: SimpleXMLElement Object ( [Package] = SimpleXMLElement Object ( [PackageID] = 804 [PackageName] = Silver [BandwidthGB] = 20

Re: [PHP] SimpleXML - issue with getting data out of the object returned

2008-12-18 Thread German Geek
Tim-Hinnerk Heuer http://www.ihostnz.com On Fri, Dec 19, 2008 at 3:50 PM, Dan Joseph dmjos...@gmail.com wrote: Hi, I have a basic XML document that I am grabbing with simplexml_load_string(), here is the print_r: SimpleXMLElement Object ( [Package] = SimpleXMLElement Object

Re: [PHP] SimpleXML - issue with getting data out of the object returned

2008-12-18 Thread Dan Joseph
On Thu, Dec 18, 2008 at 10:01 PM, German Geek geek...@gmail.com wrote: $val = (string) $x-Package-PackageID; or $val = (int) $x-Package-PackageID; Ha... I would have never figured that out... Thank you to you both! That did the trick. -- -Dan Joseph www.canishosting.com - Plans start @

[PHP] Simplexml encodes output xml

2008-11-05 Thread Manoj Singh
Hi All, I am using PHP's senderxml library to generate the xml. My problem is that xml generated by this library encode some characters like , etc. Since i have to give the output xml to the device so i don't want to encode these characters. I know there is html_entity_decode method which can

[PHP] SimpleXML strange behaviour.

2008-09-09 Thread Mirco Soderi
Do you know any reason why the following code does work $xmlOperazioni = simplexml_load_file($xmlFilename); foreach($xmlOperazioni-operazione as $operazione) { if($operazione['nome'] == $operazioneRichiesta) { require($operazione['php']); break; } } but the following does not

Re: [PHP] SimpleXML strange behaviour.

2008-09-09 Thread Nathan Nobbe
2008/9/9 Mirco Soderi [EMAIL PROTECTED] Do you know any reason why the following code does work $xmlOperazioni = simplexml_load_file($xmlFilename); foreach($xmlOperazioni-operazione as $operazione) { if($operazione['nome'] == $operazioneRichiesta) { require($operazione['php']);

[PHP] simplexml

2008-07-10 Thread Joakim Ling
Hi I'm using simplexml to create some xml files. Here's a stripped example, how can I get this to work? Tried millions different ways still no joy. ?php header(Content-type: text/xml); $xml = simplexml_load_string('root/root'); $root = $xml-addChild('tests');

Re: [PHP] simplexml

2008-07-10 Thread Nate Tallman
You have to handle the html special chars. == amp; On Thu, Jul 10, 2008 at 10:59 AM, Joakim Ling [EMAIL PROTECTED] wrote: Hi I'm using simplexml to create some xml files. Here's a stripped example, how can I get this to work? Tried millions different ways still no joy. ?php

Re: [PHP] simplexml

2008-07-10 Thread Nate Tallman
You have to handle the html special chars. == amp; On Thu, Jul 10, 2008 at 10:59 AM, Joakim Ling [EMAIL PROTECTED] wrote: Hi I'm using simplexml to create some xml files. Here's a stripped example, how can I get this to work? Tried millions different ways still no joy. ?php

Re: [PHP] simplexml

2008-07-10 Thread Nathan Nobbe
On Thu, Jul 10, 2008 at 10:55 AM, Nate Tallman [EMAIL PROTECTED] wrote: You have to handle the html special chars. == amp; and if you use the SimpleXMLElement constructor, it will throw an exception, rather than just return false, which is useful, because it tells you what went wrong.

[PHP] SimpleXML and registerXPathNamespace

2008-06-13 Thread Mario Caprino
Hi, I am having problems with the below test case. I am using an extended googlebase Atom format to store my data. Included in the test case is a simplified version of my XML-document. PROBLEM: Why do I need to re-register namespace 'a' when using xpath through the result of a previous

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Nathan Nobbe
On Jan 18, 2008 12:04 PM, Carole E. Mah [EMAIL PROTECTED] wrote: I did exactly this, and still got: ?xml version=1.0 encoding=UTF-8? rss xmlns:itunes=http://www.itunes.com/dtds/podcast-1.0.dtd; version= 2.0 channel !-- snipping, some elements omitted ... --

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Carole E. Mah
On Jan 18, 2008 12:22 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: Are you trying to read an existing document into a SimpleXMLElement, or are you trying to create a SimpleXMLElement instance and generate a document from that? My impression was you were trying to do the later; please clarify and

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Carole E. Mah
based upon information from bug #43221, if you define the namespace beforehand it will work. ?php $xml = new SimpleXMLElement('root xmlns:itunes=http://apple.com/'); $n = $xml-addChild(subtitle, Musical Mockery, http://apple.com;); print_r($xml-asXml()); ? produces: ?xml version=1.0? root

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-18 Thread Nathan Nobbe
On Jan 18, 2008 2:48 PM, Carole E. Mah [EMAIL PROTECTED] wrote: On Jan 18, 2008 12:22 PM, Nathan Nobbe [EMAIL PROTECTED] wrote: Are you trying to read an existing document into a SimpleXMLElement, or are you trying to create a SimpleXMLElement instance and generate a document from that?

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-15 Thread Nathan Nobbe
On Jan 14, 2008 11:21 PM, Carole E. Mah [EMAIL PROTECTED] wrote: Yes, I tried the following: http://us3.php.net/manual/en/function.dom-domdocument-createelementns.php Same results. based upon information from bug #43221, if you define the namespace beforehand it will work. ?php $xml =

Re: [PHP] SimpleXML Bug question

2008-01-15 Thread Richard Lynch
On Tue, January 15, 2008 12:34 am, Naz Gassiep wrote: What's the current status on this bug: http://bugs.php.net/bug.php?id=39164 Regardless of what the PHP developers say in those comments, the modification of data when it is read is not correct. If it is intended behavior, then the

[PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Carole E. Mah
This is problematic code, even though it works, because it auto-generates an unnecessary xmlns: attribute: $item-addChild('itunes:subtitle', $mySubTitle,itunes); It generates the following XML: itunes:subtitle xmlns:itunes=itunesMusical Mockery/itunes:subtitle When really all we want is this:

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Nathan Nobbe
On Jan 14, 2008 10:22 PM, Carole E. Mah [EMAIL PROTECTED] wrote: This is problematic code, even though it works, because it auto-generates an unnecessary xmlns: attribute: $item-addChild('itunes:subtitle', $mySubTitle,itunes); It generates the following XML: itunes:subtitle

Re: [PHP] SimpleXML addChild() namespace problem

2008-01-14 Thread Carole E. Mah
Yes, I tried the following: http://us3.php.net/manual/en/function.dom-domdocument-createelementns.php Same results. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php

[PHP] SimpleXML Bug question

2008-01-14 Thread Naz Gassiep
What's the current status on this bug: http://bugs.php.net/bug.php?id=39164 Regardless of what the PHP developers say in those comments, the modification of data when it is read is not correct. If it is intended behavior, then the developer/s who intend it to be that way are wrong. Under no

[PHP] simplexml problem

2007-12-31 Thread Dani Castaños
Hi all! I'm using simplexml to load an xml into an object. The XML is this: ?xml version=1.0? request customerID3/customerID appNameagenda/appName ticketTypecticket_agenda_server/ticketType ticketTypeID1/ticketTypeID platformID1/platformID ticketActionaddUsersToGroup/ticketAction /request

Re: [PHP] simplexml problem

2007-12-31 Thread Nathan Nobbe
On Dec 31, 2007 7:11 AM, Dani Castaños [EMAIL PROTECTED] wrote: Hi all! I'm using simplexml to load an xml into an object. The XML is this: ?xml version=1.0? request customerID3/customerID appNameagenda/appName ticketTypecticket_agenda_server/ticketType ticketTypeID1/ticketTypeID

Re: [PHP] simplexml problem

2007-12-31 Thread Dani Castaños
Nathan Nobbe escribió: On Dec 31, 2007 7:11 AM, Dani Castaños [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: Hi all! I'm using simplexml to load an xml into an object. The XML is this: ?xml version=1.0? request customerID3/customerID appNameagenda/appName

Re: [PHP] simplexml problem

2007-12-31 Thread Nathan Nobbe
On Dec 31, 2007 10:09 AM, Dani Castaños [EMAIL PROTECTED] wrote: Thanks! Problem fixed... But I think PHP must do the cast automatically. I think it's a bug fixed in a further version than mine as I've read no problem; but just fyi, its not a bug; the behavior is as expected per the manual:

[PHP] SimpleXML error

2007-11-26 Thread Skip Evans
Hey all, I have some XML files I need to parse and then display (they have HTML formatting in them as well). They contain the following: ?xml version=1.0 ? !DOCTYPE html PUBLIC -//Gale//DTD Gale eBook Document DTD 20031113//EN galeeBkdoc.dtd html gale:versionNumber=OEB 1.2, Gale 1.3 head

Re: [PHP] SimpleXML error

2007-11-26 Thread Casey
I'm not sure, but try casting $xml-title to string, like this: $title = (string) $xml-title; On Nov 26, 2007, at 1:44 PM, Skip Evans [EMAIL PROTECTED] wrote: Hey all, I have some XML files I need to parse and then display (they have HTML formatting in them as well). They contain the

Re: [PHP] SimpleXML end of element/tag error

2007-04-10 Thread Don Don
line) How can i solve that or determine when there are no more tags to parse. JM Guillermin [EMAIL PROTECTED] wrote: And with : foreach ($xml as $cs) { . } ?? jm - Original Message - From: Don Don To: PHP List Sent: Thursday, April 05, 2007 10:32 AM Subject: [PHP

[PHP] SimpleXML end of element/tag error

2007-04-05 Thread Don Don
I am using simple xml to parse an xml file, the program parses the file and produces an error at the end of the foreach loop when it reaches the end of the tag, it tries to look for an element/tag when there is none and produces an error Call to a member function attributes() on a non-object

Re: [PHP] SimpleXML end of element/tag error

2007-04-05 Thread JM Guillermin
And with : foreach ($xml as $cs) { . } ?? jm - Original Message - From: Don Don [EMAIL PROTECTED] To: PHP List php-general@lists.php.net Sent: Thursday, April 05, 2007 10:32 AM Subject: [PHP] SimpleXML end of element/tag error I am using simple xml to parse an xml file

[PHP] SimpleXML libxml options (XInclude)

2007-02-28 Thread Ben Roberts
Hi there. I'm hoping someone can help me with what I think might be a slightly obscure problem. I'm trying to get the SimpleXML extension to read an XML file and process the XInclude statements within the XML file. The SimpleXML docs state that libxml options may be specified using the

[PHP] SimpleXML is creating nodes when it shouldn't...

2006-05-11 Thread D. Dante Lorenso
I've recently upgraded to PHP 5.1.4 from 5.1.2 and noticed that in 5.1.3 there were changes made to SimpleXML. Now, when I touch an element which didn't used to exist, instead of acting like it didn't exist, it creates it! That's horrible! Well, this used to work: ?php $xmlstr =

Re: [PHP] simplexml and serialize error

2006-04-30 Thread Richard Lynch
On Sat, April 29, 2006 8:30 pm, Anthony Ettinger wrote: Warning: var_dump() [function.var-dump]: Node no longer exists in Foo.php on line 78 object(SimpleXMLElement)#86 (0) { } [title]= I turn an xml string into a simplexml object, and then ran serialize() on it before caching the output

Re: [PHP] simplexml and serialize error

2006-04-30 Thread Jochem Maas
Richard Lynch wrote: On Sat, April 29, 2006 8:30 pm, Anthony Ettinger wrote: Warning: var_dump() [function.var-dump]: Node no longer exists in Foo.php on line 78 object(SimpleXMLElement)#86 (0) { } [title]= I turn an xml string into a simplexml object, and then ran serialize() on it before

[PHP] simplexml and serialize error

2006-04-29 Thread Anthony Ettinger
Warning: var_dump() [function.var-dump]: Node no longer exists in Foo.php on line 78 object(SimpleXMLElement)#86 (0) { } [title]= I turn an xml string into a simplexml object, and then ran serialize() on it before caching the output locally. When I read it back in and run unserialize() to do a

Re: [PHP] simpleXML - simplexml_load_file() timeout? [Resolved]

2006-04-11 Thread darren kirby
Just replying to my original post as means of a follow up. I have gone ahead and used Rasmus' code, he was correct in surmising I was only worried about an overloaded and slow responding site. It would be very atypical for the site to be down completely. While the cache code was very

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread tedd
Here is an example Wez wrote years ago: -snip code - Years ago? stream_socket_client() is php5. How long ago did php5 launch? tedd -- http://sperling.com -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Rasmus Lerdorf
tedd wrote: Here is an example Wez wrote years ago: -snip code - Years ago? stream_socket_client() is php5. How long ago did php5 launch? The first beta was in June 2003. But the streams code was written well before that. -Rasmus -- PHP General Mailing List (http://www.php.net/) To

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread tedd
At 10:31 AM -0700 4/11/06, Rasmus Lerdorf wrote: tedd wrote: Here is an example Wez wrote years ago: -snip code - Years ago? stream_socket_client() is php5. How long ago did php5 launch? The first beta was in June 2003. But the streams code was written well before that. -Rasmus I'm

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Richard Lynch
On Mon, April 10, 2006 10:21 pm, Robert Cummings wrote: On Mon, 2006-04-10 at 23:11, Richard Lynch wrote: On Mon, April 10, 2006 9:59 pm, Rasmus Lerdorf wrote: Richard Lynch wrote: I've added a Note to 'fopen' so maybe others won't completely miss this feature and look as foolish as I do

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Richard Lynch
On Mon, April 10, 2006 10:24 pm, Rasmus Lerdorf wrote: You could volunteer to help maintain the user notes. I've just spent five/ten minutes with Google and php.net trying to find the best way to volunteer to do just that... Admittedly not a LOT of effort, but... Where do I start? I do have

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-11 Thread Rasmus Lerdorf
Richard Lynch wrote: On Mon, April 10, 2006 10:24 pm, Rasmus Lerdorf wrote: You could volunteer to help maintain the user notes. I've just spent five/ten minutes with Google and php.net trying to find the best way to volunteer to do just that... Admittedly not a LOT of effort, but... Where

[PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread darren kirby
Hello all, My website uses simpleXML to print the headlines from a few different RSS feeds. The problem is that sometimes the remote feed is unavailable if there are problems with the remote site, and the result is that I must wait for 30 seconds or so until the HTTP timeout occurs, delaying

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Robert Cummings
On Mon, 2006-04-10 at 15:25, darren kirby wrote: Hello all, My website uses simpleXML to print the headlines from a few different RSS feeds. The problem is that sometimes the remote feed is unavailable if there are problems with the remote site, and the result is that I must wait for 30

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread darren kirby
quoth the Robert Cummings: Why do you do this on every request? Why not have a cron job retrieve an update every 20 minutes or whatnot and stuff it into a database table for your page to access? Then if the cron fails to retrieve the feed it can just leave the table as is, and your visitors

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Robert Cummings
On Mon, 2006-04-10 at 17:46, darren kirby wrote: quoth the Robert Cummings: Why do you do this on every request? Why not have a cron job retrieve an update every 20 minutes or whatnot and stuff it into a database table for your page to access? Then if the cron fails to retrieve the feed

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread darren kirby
quoth the Robert Cummings: On Mon, 2006-04-10 at 17:46, darren kirby wrote: quoth the Robert Cummings: Why do you do this on every request? Why not have a cron job retrieve an update every 20 minutes or whatnot and stuff it into a database table for your page to access? Then if the

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Martin Alterisio
Maybe you can read the contents of the feeds using fsockopen() and stream_set_timeout() to adjust the timeout, or stream_set_blocking() to read it asynchronously, and then load the xml with simplexml_load_string(). PS: I forgot to reply to all and mention you'll have to send the GET http command

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread darren kirby
quoth the Martin Alterisio: Maybe you can read the contents of the feeds using fsockopen() and stream_set_timeout() to adjust the timeout, or stream_set_blocking() to read it asynchronously, and then load the xml with simplexml_load_string(). Hello, and thanks for the response, As Robert

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Rasmus Lerdorf
Martin Alterisio wrote: Maybe you can read the contents of the feeds using fsockopen() and stream_set_timeout() to adjust the timeout, or stream_set_blocking() to read it asynchronously, and then load the xml with simplexml_load_string(). PS: I forgot to reply to all and mention you'll have to

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 4:46 pm, darren kirby wrote: quoth the Robert Cummings: Why do you do this on every request? Why not have a cron job retrieve an update every 20 minutes or whatnot and stuff it into a database table for your page to access? Then if the cron fails to retrieve the feed

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Richard Lynch
On Mon, April 10, 2006 6:17 pm, Rasmus Lerdorf wrote: Martin Alterisio wrote: Maybe you can read the contents of the feeds using fsockopen() and stream_set_timeout() to adjust the timeout, or stream_set_blocking() to read it asynchronously, and then load the xml with simplexml_load_string().

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread darren kirby
quoth the Richard Lynch: Perhaps, then, you should: maintain a list of URLs and acceptable age of feed. Attempt to snag the new content upon visit, if the content is old Show the old content if the feed takes longer than X seconds. I really do like this idea, as I would rather use an old feed

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Robert Cummings
On Mon, 2006-04-10 at 20:52, darren kirby wrote: quoth the Richard Lynch: Perhaps, then, you should: maintain a list of URLs and acceptable age of feed. Attempt to snag the new content upon visit, if the content is old Show the old content if the feed takes longer than X seconds. I

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Richard Lynch
When I do get something figured out I will post results here. Problem is, with either method I need to find a feed that is slow to test with. If I test it with a bunk url it will just 404 immediately right? Is there a way to simulate a slow connection? I dunno about similating a slow

Re: [PHP] simpleXML - simplexml_load_file() timeout?

2006-04-10 Thread Martin Alterisio \El Hombre Gris\
Maybe it's too late to say this, but if your real problem is that you don't want the function reading the rss feed to block the rest of your page, you can always put the output of the reading of the feed on a separate page, and include this through an iframe. darren kirby wrote: Hello all,

  1   2   >