0

I have never used XMl perser directly.When i was going through xml beans i got a doubt which may be stupid(apologies for that) and here it goes

Use of xml parser is to parse through a xml and store its values.

User of xml beans is to represent a xml as a java bean and make it simple (i think it iwill take schema as a input).

In a way both are used for same purpose (xml parsing) can i say that java xml beans is a advanced and sopisticated way of parsing a xml?

Thanks KD

Kranthi
  • 51
  • 1
  • 1
  • 5

2 Answers2

0

Xml beans is a way to serialize your data.

Take a look to the ecore technology: there is a way to create xmi for any bean object your created. There is a really good article on Vogella about it:

http://www.vogella.com/articles/EclipseEMFPersistence/article.html

  • Thanks for the reply. but the defination of xml beans says that "XMLBeans is a technology for accessing XML by binding it to Java types. XMLBeans provides several ways to get at the XML" in this way both XMLBeans and xml parsers are serving the same purpose ?? – Kranthi Aug 23 '13 at 07:11
  • Actually, XMLBeans is an extension of xml parsing. Because you can parse xml without creating a bean. It's just a way to bind your object and a xml file. Which means, its a way to have persistance for your data. – Adrien Hadj-Salah Aug 23 '13 at 07:24
0

JAXB can import XML to Java and export Java to XML.

Here are a few tutorials of using JAXB.

http://www.oracle.com/technetwork/articles/javase/index-140168.html

http://jaxb.java.net/tutorial/

user2601995
  • 6,463
  • 8
  • 37
  • 41