Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

easy XML parsing ?

Posted on 2004-09-05
6
Medium Priority
?
222 Views
Last Modified: 2013-11-23
ok, this should be very easy if you know it ...

Until now i've been parsing my XMLs with the SAX API in the xerces.jar library. My problem was that I was using it in an applet and slapping xerces along with the applet was making it too big...

So i wandered around the java packages searching for another way to parse the bastards (I just read an already made xml). And I found this:


SAXParser parser;
try {
parser = SAXParserFactory.newInstance().newSAXParser();
} catch (Exception ex) {
ex.printStackTrace();
}

and later I call

parser.parse(InputSource is, DefaultHandler dh)

.... and it works ! with no xerces ...

So my question is this: have I been living under a rock ??? the package javax.xml.parsers.* contains a real implemetation of an XML parser (however simple that is) ??? and this should work with no xerces, just the jre installed ??

thanks
0
Comment
Question by:hapciu
6 Comments
 
LVL 19

Expert Comment

by:ramazanyich
ID: 11986173
xerces is included into JDK1.4.
0
 
LVL 19

Expert Comment

by:ramazanyich
ID: 11986189
If you check API documentation of J2SE1.4 you will see that it is javax.xml.* is included into standard API of java1.4
0
 

Author Comment

by:hapciu
ID: 11986222
included in JDK.
so any user (not developer) having JRE1.4.x (not JDK) installed, should have no problems using my applet (even if i don't put xerces.jar in my codebase) ?
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
LVL 28

Expert Comment

by:rrz
ID: 11986525
>so any user
Any user with the Java Plug-in 1.4  .
0
 
LVL 19

Accepted Solution

by:
ramazanyich earned 60 total points
ID: 11987259
Yes, any user who has installed JRE 1.4
0
 
LVL 30

Expert Comment

by:Mayank S
ID: 11987841
>> should have no problems using my applet

Did you use xerces in an Applet? Does the client have an M$ VM or Sun's VM?
0

Featured Post

Hire Technology Freelancers with Gigs

Work with freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely, and get projects done right.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Introduction Java can be integrated with native programs using an interface called JNI(Java Native Interface). Native programs are programs which can directly run on the processor. JNI is simply a naming and calling convention so that the JVM (Java…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
Suggested Courses

824 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question