Gilles,

SAX XML parsing works within the "push" model, i.e.
the API calls you. You provide the callback functions 
by overriding the base class, see saxclass definition.
For the XML nodes events, these functions are called on,
thus yielding a "visitor" design pattern.

In your class you maintain the state and selectively
process the events. The event for text between tags
is called "characters".
It is demoed in the "table" and "rss" examples.

In "rss" example, a simple stack of nested elements is
maintained in the "S" list. Then "characters" processes
the text accroding to the current context.

You can pass the result for "process" in the
output of "endDocument", which is the last event called.


--- Gilles Kirouac <[EMAIL PROTECTED]> wrote:

> Oleg Kobchenko has published an XML addon to parse XML data; 
> see Oleg's J Page http://olegykj.sourceforge.net/ where 
> you can find many useful utilities.
> 
> After studying the given examples, I tried
> 
>    process_psax2_ '<root><P>Hi!</P></root>'
> [root ]
>   [P ]
>   [/P]
> [/root]
> 
> This is the expected result.
> 
> I also studied the chess data example.
> 
> But I have not found how to extract data 
> between the start and end tags such as in the example above.
> 
> A little help would be most useful!
> 
> Gilles
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
> 


__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to