Solved

easy XML parsing ?

Posted on 2004-09-05
6
178 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 27

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 20 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

For customizing the look of your lightweight component and making it look opaque like it was made of plastic.  This tip assumes your component to be of rectangular shape and completely opaque.   (CODE)
An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Viewers will learn about if statements in Java and their use The if statement: The condition required to create an if statement: Variations of if statements: An example using if statements:
Viewers will learn about basic arrays, how to declare them, and how to use them. Introduction and definition: Declare an array and cover the syntax of declaring them: Initialize every index in the created array: Example/Features of a basic arr…

932 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now