Solved

easy XML parsing ?

Posted on 2004-09-05
6
188 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
how to install java on RHEL image on EC2 4 55
going to wrong jsp page 2 46
ejb entity bean example 2 31
How to configure empty element in XML Document parser? 15 44
In this post we will learn different types of Android Layout and some basics of an Android App.
In this post we will learn how to connect and configure Android Device (Smartphone etc.) with Android Studio. After that we will run a simple Hello World Program.
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
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 …

762 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