This week's book giveaway is in the JavaScript forum.
We're giving away four copies of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js and have Paul Jensen on-line!
See this thread for details.
Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

xml handling  RSS feed

 
manish ahuja
Ranch Hand
Posts: 312
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

Traditionally I have been using JAXP or JDOM for handling xml payloads in java where we use the DOM or SAX api for handling xml.
Alternatively there are java2xml and viceversa api libraries available like JAXB, Castor and XMLBeans.
I was wondering when to go for raw xml handling using libraries like JAXP , JDOM and when to resort to java-xml bridging toolkits like castor.

Do post your thoughts on the same.

Thanks
 
Pavel Cherkashin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
As far as raw nodes <-> fields bridge is considered, the Dom4j is very usable. It implements xpath and to access every node or attribute of the document is easy.


This tool works with raw xml and raw beans and abstract the developer from handling "nodeStarted" and "nodeEnded" etc.
 
Pavel Cherkashin
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Of course if there is a reason to use more abstract binding, then it depends from special needs. Sometimes it is needed to specify the structure of the xml data. Sometimes it is needed to handle the inheritance of data beans. The large byte arrays and multi part data content - is a special topic. The validation of values is also form time to time being the topic to discuss when selecting the tool.

You're the driver.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!