java - Best way to get a single value from request returning xml? -


i have android app, , specific value xml result set, getting request api. making multiple requests, , request returns xml.

here xml result:

https://mcxnow.com/orders?cur=wdc

how value of 'doc > history > o[0] > p' string efficiently possible in java android?

i've looked @ sax xml parser seems overkill. there lightweight should use? should use, , how go getting 1 value?

i've looked @ sax xml parser seems overkill. there lightweight should use? should use, , how go getting 1 value?

i going recommend use sax parser!


the problem thing more "light-weight" in performance terms pattern matching; i.e. ignoring xml grammar / syntax, , using regexes or equivalent fish out data want.

the problem using pattern matching instead of proper xml parsing code liable fragile:

  • it liable break in unpredictable / undetectable fashion if implied xml schema changes.

  • it liable break in unpredictable / undetectable fashion variations in way xml formatted; e.g. non-significant white-space, attributes in unexpected order, , on.

  • it liable break in unpredictable / undetectable fashion if values encoded in legal unexpected ways.

and if design regexes cope these things, more complicated , pattern matching performance drops.


Comments

Popular posts from this blog

html - Sizing a high-res image (~8MB) to display entirely in a small div (circular, diameter 100px) -

java - IntelliJ - No such instance method -

identifier - Is it possible for an html5 document to have two ids? -