Re: XML Parsing Error in Google Shopping Feed

2014-09-09 Thread José Lorenzo
Read about XML CDATA, this will help you http://stackoverflow.com/questions/2784183/what-does-cdata-in-xml-mean On Monday, September 8, 2014 7:53:15 PM UTC+2, Rafael Queiroz wrote: > > Hi, > > I'm trying Google Shopping feed in my app, i using Cake 2.2.5, > parseExtensions and RequestHandler res

Re: xml parsing problem

2009-06-11 Thread robert123
when i did var_dump($parsed_xml); it shows array(1) { ["Order"]=> array(1) { ["id"]=> string(7) "3525314" } } hence when the xml was parsed to array only one record is stored into the array, my question is anyone knows how to get the 2 records into an array? Thank you On Jun 11, 4:48 pm, paul

Re: xml parsing problem

2009-06-11 Thread paulos nikolo
Try use the var_dump() or debug().I had the same problem and i am using the debug().To be more specific here is some code which might help you: $results = $parsed_xml =& new XML($results); $parsed_xml = Set::reverse($parsed_xml); debug($results); (or var_dump($results)

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] => default [useTable] => teams [displayFiel

Re: XML parsing

2009-04-17 Thread smithtrev...@googlemail.com
I had it on debug level 2, so I changed it to level 3 to see if I could find anything out. It produces this, which looks like it should save properly to me. My table has 3 fields, id, name and specialid. [useDbConfig] => default [useTable] => teams [displayFiel

Re: XML parsing

2009-04-16 Thread mscdex
On Apr 16, 7:07 pm, "smithtrev...@googlemail.com" wrote: > Thanks for your help mxcdex. > It all is working fine, except the line: > > $success = $this->Team->saveAll($xml['Teams']); > > This doesn't save anything, or appear to be doing anything. It doesn't > produce an error message, nor does it

Re: XML parsing

2009-04-16 Thread smithtrev...@googlemail.com
Thanks for your help mxcdex. It all is working fine, except the line: $success = $this->Team->saveAll($xml['Teams']); This doesn't save anything, or appear to be doing anything. It doesn't produce an error message, nor does it save the records. I've tried all combinations of Team, Teams, team an

Re: XML parsing

2009-04-09 Thread mscdex
On Apr 9, 3:08 pm, "smithtrev...@googlemail.com" wrote: > Ok, now I've done that, I've spent the last couple of hours trying to > insert the parsed xml into a database table called teams. > Well, depending on what your table columns are named, you may need to change some of the keys in the array

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Ok, now I've done that, I've spent the last couple of hours trying to insert the parsed xml into a database table called teams. However, I am struggling to do so. I've had a few tries using a number of different methods. http://abeautifulsite.net/notebook/42 http://www.codewalkers.com/c/a/Databa

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Ok, I've managed to do it by using the XML file directly from the website, and not using a local copy. This is definitely much better. Thanks for your help. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" gr

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Ok, I tried the test, and also print_r($parsed_xml) and var_dump ($parsed_xml). When I tried the test, with all of them except var_dump($parsed_xml), it again just showed "Array". But with var_dump($parsed_xml) it shows: array(1) { ["Testxml"]=> array(2) { ["test2"]=> string(17) "Content of tes

Re: XML parsing

2009-04-09 Thread Mathias Hunskår Furevik
Hi, $parsed_xml should be an array representation of the XML. If nothing is returned (you could also try print_r($parsed_xml) or var_dump($parsed_xml) ) then your XML is probably malformed or not loaded. Try making a simple test like this and show us the output: $tstxml = " Content of test 2 Co

Re: XML parsing

2009-04-09 Thread smithtrev...@googlemail.com
Thanks for your help. I've been using this code and I think it's sort of worked. function index() { App::import('Xml'); $file = "http://localhost\parses\y.xml";; $parsed_xml =& new XML($file); $parsed_xml = Set::reverse($parsed_xml); // this is what i call magic debug($pars

Re: XML parsing

2009-04-07 Thread mscdex
There's one quick way to get the XML into PHP array form: App::import('Xml'); $xml =& new XML($XMLfilename); $xml = Set::reverse($xml); where $XMLFilename can either be a filename containing XML or a raw XML string --~--~-~--~~~---~--~~ You received this message b

Re: XML parsing

2009-04-07 Thread Mathias Hunskår Furevik
PHP has several XML functions/classes built in, as well as several third-party classes. You could use xpath to loop the data and save. There are also some third-party classes that returns an array. This is probably easier to work w

Re: XML Parsing Error: xml declaration not at start of external entity

2008-04-20 Thread Federico Rinaldi
Thanks Wayne! I had the same issue and it was caused by a space in a helper. On Wed, Oct 31, 2007 at 3:18 PM, Wayne Fay <[EMAIL PROTECTED]> wrote: > > Yes, this is a not-uncommon PHP error, and it causes problems in many > places. > > Wayne > > On 10/31/07, seacloud9 <[EMAIL PROTECTED]> wrote:

Re: xml parsing

2007-11-05 Thread cronet
Hi, I'm also running SimpleXML. It looked easier than the Cake XML Class. As Langdon Stevenson said, try it, if it fits your need, use it ;) Greetings On 2 Nov., 21:02, moesian <[EMAIL PROTECTED]> wrote: > Hi, > > I want to parse a few xml feeds and stick their contents into a > database. Wh

Re: xml parsing

2007-11-02 Thread Langdon Stevenson
Hi Moesian I have recently used simplexml to parse and modifiy some svg image files and (once I got used to it) found it easy to work with. It is fairly limited (as the name implies), but if it has the tools to do the job you need, then I would use it. Regards, Langdon moesian wrote: > Hi,

Re: XML Parsing Error: xml declaration not at start of external entity

2007-10-31 Thread Wayne Fay
Yes, this is a not-uncommon PHP error, and it causes problems in many places. Wayne On 10/31/07, seacloud9 <[EMAIL PROTECTED]> wrote: > > Fixed it. CakePHP users beware of leaving spaces in your model, > controller, view etc.. This error was a pain to track down. All it > takes is one space an

Re: XML Parsing Error: xml declaration not at start of external entity

2007-10-31 Thread seacloud9
Fixed it. CakePHP users beware of leaving spaces in your model, controller, view etc.. This error was a pain to track down. All it takes is one space and your fun bus is up on blocks for RSS... Only took a couple of days to track down... On Oct 31, 12:11 pm, seacloud9 <[EMAIL PROTECTED