Welcome to the dBforums forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions, articles and access our other FREE features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload your own photos and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact support.

If you prefer not to see double-underlined words and corresponding ads, place your cursor
here for ContentLink opt out.

Go Back  dBforums > Data Access, Manipulation & Batch Languages > JAVA > xml-java

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 06-25-08, 04:43
dimis2500 dimis2500 is offline
Registered User
 
Join Date: Jan 2005
Posts: 337
xml-java

I Have a xml file and I want to read it and import to mysql the values of xml file.
It is good to use a xml parser (and what may be better) or just to uses the libraries of jdk?
The records of xml file is about 55000 as I know.
Dimis
Reply With Quote
  #2 (permalink)  
Old 07-05-08, 21:12
sco08y sco08y is offline
Registered User
 
Join Date: Oct 2002
Location: Fort Polk, LA
Posts: 500
You'd want to use an event-based parser that conforms to the SAX protocol. As I recall it is included at least with JDK 1.5.

DOM parsers are easier to use, but they load the whole document into memory which you don't really need to do. All you care about is when the appropriate tags are encountered.
Reply With Quote
  #3 (permalink)  
Old 07-07-08, 15:09
gutierrez.ge gutierrez.ge is offline
Registered User
 
Join Date: Jul 2008
Posts: 2
you can use xpath expression with jaxen library (i thing there is another one from apache called xpath as well) and then you can query the tags instead of implementing your own reading, i think it would be faster.

Hope it helps
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On