java - What is the best and optimized way to extract data from XML multiple times? -


in our application had requirement retrieve data xml multiple times. make service call, data in xml format , save in memory. later need retrieve data using either element name or attribute name multiple times , makes parse xml each , every time not way go.

we have limitation of saving string in memory , cannot use spring or framework either can save xml or convert string format , parse string. these options think off:

  1. parse xml every time need retrieve value.
  2. extract required data xml using parser , save map in string format , parse map data using custom code.
  3. convert big xml small xml , parse small xml every time.
  4. string split functions.

appreciate if 1 can suggest fast way retrieve data string

since author of vtd-xml, must acknowledge point of view may biased. vtd-xml ideal use case.

let me explain more:

*first parsing not big problem dom vtd-xml.

  • you can choose persist parsed result vtd-xml's built-in indexing. basically, if can reuse same xml without parsing more once ... handy this... load .vxl file memory. vtd-xml has 2 parts, xml (literal xml human readable). other binary index part output of parsing.

  • since vtd-xml uses far less memory dom. point #3 may become unnecessary.

  • also vtd-xml's indexing strucuture super easy understand. can written on of match box.

  • also vtd-xml perfect big xml splitting if understand underlying principle of it...

let me know if got question.


Comments

Popular posts from this blog

android - InAppBilling registering BroadcastReceiver in AndroidManifest -

python Tkinter Capturing keyboard events save as one single string -

sql server - Why does Linq-to-SQL add unnecessary COUNT()? -