Solved

easy XML parsing ?

Posted on 2004-09-05
6
201 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
[Live Webinar] The Cloud Skills Gap

As Cloud technologies come of age, business leaders grapple with the impact it has on their team's skills and the gap associated with the use of a cloud platform.

Join experts from 451 Research and Concerto Cloud Services on July 27th where we will examine fact and fiction.

 
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

Independent Software Vendors: 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!

Question has a verified solution.

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

Java contains several comparison operators (e.g., <, <=, >, >=, ==, !=) that allow you to compare primitive values. However, these operators cannot be used to compare the contents of objects. Interface Comparable is used to allow objects of a cl…
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
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…
Suggested Courses

617 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