Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML to Java

 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need java bean representation of an XML file. So I guess Digester is the one to be used. I do see that it is being used by other products like Struts to construct java representation of config files. More importantly does it perform well for say an XML file of size say 5MB? Any indicators of performance of digester?
thanks
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is Digester similar to JAXB?
 
Karthik Guru
Ranch Hand
Posts: 1209
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Is Digester similar to JAXB?

Yes the concept look similar. I have'nt used either of them though . Except that i'm really looking forward to use digester if it satisfies our requirement.Performance is our only concern.
 
Pradeep bhatt
Ranch Hand
Posts: 8927
Firefox Browser Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Does Digester support XML schema?
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by karthik Guru:
I need java bean representation of an XML file. So I guess Digester is the one to be used. I do see that it is being used by other products like Struts to construct java representation of config files. More importantly does it perform well for say an XML file of size say 5MB? Any indicators of performance of digester?
thanks

digester is based on SAX2 model. I am sure that it is more faster than JAXB.
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Does Digester support XML schema?

Yes. but A bug in Xerces 2.0.2 prevents the support of XML schema. You need Xerces 2.1 or JAXP 1.2.1 to make it working with XML schema.
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Pradeep Bhat:
Is Digester similar to JAXB?

Digester is like SAX2 (it is based on sax2 actually). It is better used to read a xml document.
While JAXB is a JSR which is based on xml schema for the mapping. And you can read or write xml document using JAXB.
I have used both of them. And found that Digester is faster than JAXB RI in reading.
 
Mike Wang
Ranch Hand
Posts: 76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
A good introduction to common Digester
http://www.onjava.com/pub/a/onjava/2002/10/23/digester.html
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic