[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: User defined SAX ContentHandler

Subject: Re: User defined SAX ContentHandler
From: Prakash <prakash.subramaniam@xxxxxxxxxx>
Date: Wed, 10 Aug 2005 19:36:50 +0530
Re:  User defined SAX ContentHandler
My opinions:

1. First of all, one minor correction: SAX is not a W3C standard.
2. I don't think this is a practical idea, because as someone has mentioned, it is going to involve too much of reflection overheads and messy code generations. But, even if we do that, what are we going to achieve by that? If your idea is to generate strongly typed application specific Xml datastructure for an Xml instance, you can take a look at JAXB.


Thanks,
Prakash

Ramkumar Menon wrote:

Hi All,

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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.