Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2008

Tip: Looking for answers? Try searching our database.

SAX parsing problem, when element contains text like "[text]"

Thread view: 
Kai Schlamp - 27 Mar 2008 19:57 GMT
Hello.

I try to parse some XML results of PubMed (the largest biomedical
article database).
The document contains elements like this: <articletitle>[Virus and RNA
silencing]</articletitle>
Now my problem is that the characters function of my SAX handler is
called twice for "[Virus and RNA silencing]".
The first time I get "[Virus and RNA silencing" and the second time
"]".
I am not very experienced regarding XML and XML processing. Why does
this happen? Why not one call for "[Virus and RNA silencing]"? And is
there a way to set a property for SAX to behave that (only one call)
way?

Best regards,
Kai
Arne Vajhøj - 27 Mar 2008 21:36 GMT
> I try to parse some XML results of PubMed (the largest biomedical
> article database).
[quoted text clipped - 8 lines]
> there a way to set a property for SAX to behave that (only one call)
> way?

This is expected behavior of a SAX parser.

You characters method should accumulate content and
endElement do the final processing.

Arne


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.