xsl-list
[Top] [All Lists]

RE: User defined SAX ContentHandler

2005-08-10 10:53:15
A very early version of Saxon provided this kind of capability; you could
nominate the method to be called for each element node by supplying a
pattern, like an XSLT pattern. The method wouldn't be startEmployee, it
would be startElement in an EmployeeHandler class. So it's quite viable, and
can be built as a layer above SAX; it just never caught on.

Michael Kay
http://www.saxonica.com/

 

-----Original Message-----
From: Ramkumar Menon [mailto:ramkumar(_dot_)menon(_at_)gmail(_dot_)com] 
Sent: 10 August 2005 07:21
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] User defined SAX ContentHandler

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

-- 
Shift to the left, shift to the right!
Pop up, push down, byte, byte, byte!

-Ramkumar Menon
 A typical Macroprocessor

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: 
<mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--





--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--