Re: [PHP] Good XML Parser

2008-05-14 Thread Shelley
Thank you all. Maybe you didn't get what I meant. I have made it working excellent for me. I have summarized the solution: http://phparch.cn On Wed, May 14, 2008 at 11:10 AM, Nathan Nobbe <[EMAIL PROTECTED]> wrote: > On Tue, May 13, 2008 at 7:29 PM, Waynn Lue <[EMAIL PROTECTED]> wrote: > > > Ok,

Re: [PHP] Good XML Parser

2008-05-13 Thread Nathan Nobbe
On Tue, May 13, 2008 at 7:29 PM, Waynn Lue <[EMAIL PROTECTED]> wrote: > Ok, thanks so much for the help. I went with DOM-parsing to begin > with, I'll explore XPath + SimpleXML later. just fyi, youre likely to get more bang for your buck starting off w/ SimpleXML. DOM is a successor to DOMXML

Re: [PHP] Good XML Parser

2008-05-13 Thread Waynn Lue
Ok, thanks so much for the help. I went with DOM-parsing to begin with, I'll explore XPath + SimpleXML later. Thanks, Waynn On Mon, May 12, 2008 at 5:23 AM, David Otton <[EMAIL PROTECTED]> wrote: > 2008/5/12 Waynn Lue <[EMAIL PROTECTED]>: >> So if I'm looking to parse certain attributes out of a

Re: [PHP] Good XML Parser

2008-05-12 Thread David Otton
2008/5/12 Waynn Lue <[EMAIL PROTECTED]>: > So if I'm looking to parse certain attributes out of an XML tree, if I > use SAX, it seems that I would need to keep track of state internally. > E.g., if I have a tree like > > > > > > > > > > > and say I'm interested in all that's betwe

Re: [PHP] Good XML Parser

2008-05-12 Thread Bojan Tesanovic
Here is the very simple way ;) First Second XMLL; $X = simplexml_load_string($XML); foreach ($X->a as $a){ echo $a->b ."\n"; if( $a->b['class'] ) { echo 'B has class - ' .$a->b['class']."\n"; } } ?> On May 12, 2008, at 1:28 PM,

Re: [PHP] Good XML Parser

2008-05-12 Thread Bojan Tesanovic
Fot SImpler XMLs and not too large up to 1Mb I would use $X = simplexml_load_file($URL); simple xml is fairly fast and is very easy to use it accepts foreach loops, accessing attributes via array fashion etc On May 12, 2008, at 9:02 AM, Waynn Lue wrote: What's the best way to pull down

Re: [PHP] Good XML Parser

2008-05-12 Thread Waynn Lue
So if I'm looking to parse certain attributes out of an XML tree, if I use SAX, it seems that I would need to keep track of state internally. E.g., if I have a tree like and say I'm interested in all that's between underneath any , I'd need to have a state machine that loo

Re: [PHP] Good XML Parser

2008-05-12 Thread David Otton
2008/5/12 Waynn Lue <[EMAIL PROTECTED]>: > What's the best way to pull down XML from a URL? fopen($URL), then > using xml_parse? Or should I be using XML_Parser or SimpleXML? XML parsers fall into two general camps - DOM and SAX. DOM parsers represent an entire XML document as a tree, in-memory,

[PHP] Good XML Parser

2008-05-12 Thread Waynn Lue
What's the best way to pull down XML from a URL? fopen($URL), then using xml_parse? Or should I be using XML_Parser or SimpleXML? Thanks, Waynn -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php