Skip to main content

I need a tutorial for JAXP...

5 replies [Last post]
demonduck
Offline
Joined: 2008-03-14
Points: 0

It's been 9 years since the last time I did a SAX (or is it now JAXP) XML parser.

I have a little applet that needs to read a simple XML file and I don't remember squat about how to put a SAX parser together anymore.

There must be a tutorial some where that will get me started.

Could someone post a link???

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
joehw
Offline
Joined: 2004-12-15
Points: 0

JAXP has been moved from J2EE to J2SE. The Doc team has been working on a separate tutorial for JAXP. Meanwhile, could you try the basic SAX tutorial in the J2EE 1.4 Tutorial and see if that works for you?

J2EE Tutorial:
http://java.sun.com/j2ee/1.4/docs/tutorial/doc/

Please let us know.

Thanks.

demonduck
Offline
Joined: 2008-03-14
Points: 0

Hi joehw,

After I posted, I looked around SUN's Java site and couldn't find anything useful.

So I did a google search and your tutorial turned up near the top of the list as I recall.

It's excellent! I think it tells me all I need to know. Setting up the Handler is the critical piece and it explains that process very well. So I think my question is answered.

Just don't get me started on the disorganized state of java.sun.com... :-)

Thanks!

demonduck
Offline
Joined: 2008-03-14
Points: 0

P.S.

Moving JAXP and SAX and DOM to J2SE is an excellent idea. I only write applets. And there is always some sort of configuration information that the applet needs to do it's thing. And I'm alway inventing a format for those config files and writing another string lex'er to figure out what the info in the config file is.

Having XML available to applets without any special install is a really good thing. XML is really handy and the free tools to write schema's and XML files make the whole process much more standardized and robust and portable.

joehw
Offline
Joined: 2004-12-15
Points: 0

Thanks for the feedback! I'm glad to know it works for you. I was wondering if you'd come back and say that's too old :)

By the way, I thought you might be interested to know that, besides SAX and DOM, JAXP 1.4/JDK6 also support StAX. There are some samples if you download the JAXP 1.4.2 jar from here https://jaxp.dev.java.net/servlets/ProjectDocumentList?folderID=4585&exp...

--Joe

demonduck
Offline
Joined: 2008-03-14
Points: 0

> Thanks for the feedback! I'm glad to know it works
> for you. I was wondering if you'd come back and say
> that's too old :)

The only thing that's too old is me... :-) No, but seriously, SAX hasn't really changed all that much in the last 8-9 years since I last used it. JAXP well that's all new stuff to me but I like to keep it simple. I don't mind rolling my own stuff at the lowest level. Always has seemed easier to get exactly what I want rather than taking what the high level stuff has to put out in order to be "...one size fits all..." -- if you get my drift.

> By the way, I thought you might be interested to know
> that, besides SAX and DOM, JAXP 1.4/JDK6 also support
> StAX. There are some samples if you download the JAXP
> 1.4.2 jar from here
> https://jaxp.dev.java.net/servlets/ProjectDocumentList
> ?folderID=4585&expandFolder=4585&folderID=0
>
> --Joe

I only have room in my head for about 1 1/2 things at a time. SAX is plenty right now...