Page 1 of 1

parsing really long string (of xml format)

Posted: Tue Aug 04, 2009 12:32 am
by bsharp42
Hello,

I have this really long XML-format string that I need to parse. I guess the first question I should ask is, is there a way to parse XML so that I can get the "attributes" of the child tag ??

lets say I have

......
<child childID="948390">
blah blah
</child>
.............

Is there a way for me to get the IDs ???

If not, I was thinking of just parsing the string itself.

I tried sscanf( $the_xml_string, "childID=\"%d\"", $ID); but it didn't do anything...

Re: parsing really long string (of xml format)

Posted: Tue Aug 04, 2009 12:58 am
by bsharp42
Also, I was wondering if there was something similar in PHP that equals

NSScanner : ScanUpTo function of Obj-C

Basically, the above function

"Scans the string until a given string is encountered, accumulating characters into a string that’s returned by reference."