The moose likes XML and Related Technologies and the fly likes Apache & Java Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of Practical Unit Testing with TestNG and Mockito this week in the Testing forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "Apache & Java" Watch "Apache & Java" New topic
Author

Apache & Java

Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
How is the Apache XML Project related to java and JAXP. JAXP bundles the Xalan package, which i believe is from Apache.
Out of the various packages available which is the most suitable in terms of ease of use and performance?
-----------
Amit
Kalpesh Soni
Ranch Hand

Joined: Jan 02, 2001
Posts: 306
and please tell if somebody knows
whether xerces can work with jaxp or not ?
if yes
how
------------------
"Sun Certified Java Programmer"
KS
"Failing to plan is like plannig to fail!"


Test 094, IBM WID 6.0 cert
SCJP 1.2
SCBCD 1.3 Beta
SCWCD 1.4 Beta
SCMAD Beta
SCDJWS Beta

KS
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5781
Since all the major software vendors supply their own XML parsers these days it was becoming hard for programmers to test their code with various different parsers. Even though all the parsers are written in compliance with W3C spec, instantiating and loading an instance of a particular parser required changing the Java code.
Sun Microsystems came to the rescue and wrote a convenience framework called JAXP to alleviate the pains associated with parser switching exercise. JAXP ( Java API for XML Parsing ) is a lightweight framework provided by Sun that allows you to plug-in any XML parser with your Java applications. It is important to note, JAXP is not an XML parser.
The XML initiative from Apache has produced Xerces which is an XML parser. Xalan is the XSL Tranformation engine( not a parser! ) that is also a product of Apache.
Sun has its own XML parser called Crimson that is bundled with the JAXP download. Once you download JAXP you can use any parser in your Java programs by tweaking the System Properties.
Hope that clarifies your doubts.

------------------
Ajith Kallambella M.
Sun Certified Programmer for the Java�2 Platform.
IBM Certified Developer - XML and Related Technologies, V1.


Open Group Certified Master IT Architect.
Sun Certified Architect(SCEA).
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Ajith,
Your reply was very informative. But, you missed to throw light on one aspect. i.e. which is a better parser in terms of ease of use and performance. (Crimson / Xerses)
Also, if i want to use Xerses can i simply replace the Crimson jar file with the one of Xerses and change the clsspath or there is something more i need to do? Will there be any change / recompile required in the code?
Regards,
Amit
Ashwin Asani
Greenhorn

Joined: Jun 14, 2001
Posts: 6
Hi Amit,
Why don't you try using Oracle XML Parser. It's one of the best I've found. In fact Oracle comes with XSQL Servlet that is extremely easy for generating XML documents from RDBMS and also applying XSL to the same to give an HTML output. Check out this site for more details: http://otn.oracle.com/tech/xml/
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
Originally posted by Amit Agarwal:

Your reply was very informative. But, you missed to throw light on one aspect. i.e. which is a better parser in terms of ease of use and performance. (Crimson / Xerses)
Also, if i want to use Xerses can i simply replace the Crimson jar file with the one of Xerses and change the clsspath or there is something more i need to do? Will there be any change / recompile required in the code?

IMHO.. Xerces is superior b'coz it is Serializes the xml object in memory everytime its been requested but performance wise, it is a bit slow comparatively Sun's parser. U can find out more at..
http://www.xml-zone.com/articles/sf020101/sf0201-1.asp http://www.xml-zone.com/articles/pm020101/pm020101-1.asp
For replacing Crimson with Xerces, u obviously need to change code with new import package names.
HTH...
Anil

SCJP 1.5, SCEA, ICED (287,484,486)
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5781
Originally posted by Anil Vupputuri:

For replacing Crimson with Xerces, u obviously need to change code with new import package names.

If you are using JAXP, you can simply tweak the System.properties file. That will do the magic.
Amit Agarwal
Ranch Hand

Joined: May 09, 2001
Posts: 92
Hi Ajith,
What do you mean by tweaking the System.properties file and where is this file located?
Regards,
Amit
[This message has been edited by Amit Agarwal (edited June 20, 2001).]
Anil Vupputuri
Ranch Hand

Joined: Oct 31, 2000
Posts: 527
If you are using JAXP, you can simply tweak the System.properties file. That will do the magic.

U mean, do we need to set name of the parser in the properties file, but I never found any properties file. can u light on this...
Thx.
Anil
 
 
subject: Apache & Java
 
Threads others viewed
Is anyone using SOAP in production yet?
About the new SOAP book (Brogden's)
Finding the node value in XML
JAXP tutorial?
Which one is the best XML parser?
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com