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

Re: More on taming SAX (was Re: ANN: Amara XMLToolki


xmltoolkit


Jeff Rafter wrote:

> Karl Waclawek has done some work in this area in both Delphi and C# in 
> his toolkit XPEA. But I am sure he will take some ideas from this thread 
> as well... it is all very interesting.

Well, XPEA really is a very low level way of building
some pattern matching on top of SAX (or other push APIs).
Predicate processing as well as attribute matching is done
through call-backs. I am not a big believer in inventing
new languages - my ambitions are a lot more modest.

Example (C# 2.0 syntax):

   IXmlReader reader;
   ...
   SaxPathDispatcher<EventStatus> disp = new SaxPathDispatcher<EventStatus>();
   disp.AttachTo(reader);
   /* Path related set-up */
   Div1Handler div1 = new Div1Handler(...);
   Div2Handler div2 = new Div2Handler(...);
   BasicPathFactory pathFactory = new BasicPathFactory(...);
   // Add path with call-back arguments: "/spec/*//div1[div1]/div2[div2]"
   BasicPath path = pathFactory.Create("/spec/*//div1[0]/div2[1]", div1, div2);
   path.AddTo(disp.Paths);
   ...
   reader.Parse(input);

Div1Handler and Div2Handler are implementations of the IElementHandler
interface and their events are called when they match the path above.
Really just one step more than SAX. I use it for writing SAX-based
transformations.

Karl





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
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

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.