iphone - TTXMLParser Sample Code? -


is famaliar how use ttxmlparser. can't find documentation or sample code on it.

is sax or dom?

does support xpath?

can extract cdata elements?

i have application uses several three20 modules shame have use parser.

the main documentation i've found ttxmlparser in header file. comment there gives overview of ttxmlparser does.

ttxmlparser shouldn't thought of xml parser in way thinking of -- in sense, questions such "is sax or dom" , "does support xpath" aren't directly applicable. instead, think of ttxmlparser convenience class take xml , turn tree of objective-c objects. example, xml node:

<mynode attr1="value1" attr2="value2" /> 

would turned objective-c nsdictionary node mapped key "attr1" value "value1" , key "attr2" key "value2".

ttxmlparser internally uses nsxmlparser (which sax) build tree, you, user of ttxmlparser, don't have sax-like stuff.

so, no, not end xml document on can perform xpath queries. instead, end objective-c tree of objects. if that's want, great; if want traditional xml parser xpath, i'm working on project uses both three20 , touchxml. touchxml supports xpath.

i agree it's hard find sample code ttxmlparser. three20's tttwitter sample used use ttxmlparser (well actually, tturlxmlresponse, in turn uses tturlparser), @ point changed use tturljsonresponse instead, shame, because xml sample.

you can still see old xml-based sample code here. specifically, @ -[requestdidfinishload:] function near bottom of file, example of code takes tturlxmlresponse, queries rootobject member, , walks down resulting tree of objects.


Comments

Popular posts from this blog

android - Spacing between the stars of a rating bar? -

html - Instapaper-like algorithm -

c# - How to execute a particular part of code asynchronously in a class -