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 / August 2005

Tip: Looking for answers? Try searching our database.

User defined SAX Events

Thread view: 
Ramkumar  Menon - 10 Aug 2005 07:22 GMT
Hi All,

I needed a few suggestions on a recent "Eureka whisper[not really a
shout]" I had, well, out of my bathtub.

W3C defines specific methods witihn a SA ContentHandler like
startElement(), endElement() etc... that would be called back when
elements are encountered within the XML Document.
User overrides these methods to define the logic within each of these
callback methods.

As an alternative, what if the User defines explicit methods like

public void startEmployee() [simplified here- ignoting namespace
mappings]
public void endEmployee()
public void onEmptyAdddress()
public void onAttr_Employee_Name() [this is just illustrative of the
attributes scenario.]

Advantage
-----------------

Cleaner separation of logic.
<<add here>>

Disadvantages
---------------------

No Clear contract.
<<add here>>

This is only an ilustrative subset of the functionalty.
What do you folks think of this ? Is this a better alternative ?

rgds,
Menon
Raymond DeCampo - 10 Aug 2005 15:47 GMT
Ramkumar Menon wrote:
> Hi All,
>
[quoted text clipped - 33 lines]
> rgds,
> Menon

You could easily implement a compliant SAX content handler that uses
reflection to give you the described behavior.  Why don't you try it and
let us know how it goes?  The real test is in using the new interface of
course.  Even better, you could think up a snazzy acronym and release
the source on sourceforge. :-)

Ray

Signature

XML is the programmer's duct tape.



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



©2009 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.