• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML API choices, survey

 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am learning XML. I found to much terms in this area. As a programmer, I am focus on how to solve problem. So I have these questions.

My assumption:
1. common API is first choice
2. if we could handle it in java, we will not use other high level xml API.
3. try to user ONE API to solve all problems so that we could reduce learning time.
4. simple, easy, fast-get-in is our policy.

My questions :
1. use which API to solve read, write, parse a XML file ?
---- JDOM ?

2. has a List data inside which contains a list of Object, which API could convert to XML document ?

3. I have these xml file, which API I should use to convert to html ? ---- write a jsp tag, is it a good idea ?

Thanks
 
Rajagopal Manohar
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There is no oner solution or silver bullet for all problems

Originally posted by Edward Chen:
1. use which API to solve read, write, parse a XML file ?
---- JDOM ?

Read: SAX
Write: JDOM, DOM


2. has a List data inside which contains a list of Object, which API could convert to XML document ?

You should try data binding for this look into XMLBeans, JaxB, Jibx, Castor etc


3. I have these xml file, which API I should use to convert to html ? ---- write a jsp tag, is it a good idea ?


Using xslt seems to be the way to go, DOM API supports transformations using xslt but you need to get Xalan or Saxon jar files apart from xerces


Hope it helps,
-Rajagopal
 
Rajagopal Manohar
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sorry I could not come up with one solution so that there is less for you to learn, It can be argued that we can do all you want and more using DOM or even SAX alone, may be some contrived or non intutive way, but does it mean that it is the right way?
My answer is No

-Rajagopal
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Now that the latest Java 1.5 SDK contains major XML functionality I stick with it instead of involving outside toolkits. Many of these outside toolkits were developed to overcome limitations of earlier Java standard libraries and are not required now.
Bill
 
Rajagopal Manohar
Ranch Hand
Posts: 183
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:
Now that the latest Java 1.5 SDK contains major XML functionality I stick with it instead of involving outside toolkits. Many of these outside toolkits were developed to overcome limitations of earlier Java standard libraries and are not required now.
Bill


I agree that the 1.5 supports many more functionalities than in the past and if one is working with 1.5 he should look to use them

But some outside toolkits are still relevant

JDOM: DOM is still difficult to learn and non intuitive

JiBx: Offers flexibility to work with exiting java beans and is the fastest data binding tool kit around

XMLBeans: The last time I looked JaxB did not support all schema constructs but XMLBeans did

And lastly my client still uses 1.3 and am anxiously waiting for the jump to 1.4 in a few months

-Rajagopal
 
Paul Clapham
Sheriff
Posts: 21111
32
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
3. try to user ONE API to solve all problems so that we could reduce learning time.
This is rather like saying having both Map- and List-type collections is a waste of our time. Let's just have one of them so that we can learn faster.
 
Edward Chen
Ranch Hand
Posts: 798
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by William Brogden:
latest Java 1.5 SDK contains major XML functionality


Where could I find a tutorial about JDK1.5 XML function ?

Thanks.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13064
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right offhand I don't know of a specific tutorial. I suggest you browse through the Javadocs. Look at the packages in the javax.xml group, the org.w3c group and the org.xml.sax group.
This version of JAXP (Java Api for XML Processing) is 1.3
This sun web page seems to be a good starting point to get more documenation articles, etc. on JAXP 1.3
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic