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

Re: [RefleX] Once Upon A Tag...

  • From: Philippe Poulard <Philippe.Poulard@s...>
  • To: Manos Batsis <manos_lists@g...>
  • Date: Tue, 21 Nov 2006 18:06:10 +0100

xunit reflex
Manos Batsis wrote:
> Quoting Philippe Poulard <Philippe.Poulard@s...>:
> 
>>-One of the most outstanding new feature is the ability to *filter
>>SAX
>>streams with XPath patterns* ; you'll find in the tutorial section a
>>runnable example where a 15Mo file is connected to a SAX pipeline
>>with a
>>rule-based filter...
> 
> 
> Does this work for any XPath axis maybe by creating buffers driven by
> expressions etc? Reminds me of STX:
> 
> http://stx.sourceforge.net/
> 

The strategy is simple : if you read forward, you'll have the nodes, if 
you read backward, you won't have them, so you should anticipate and 
"cast" that part of the subtree from a SAX document to a DOM document, 
as shown in the tutorials.

Almost everything available in XPath patterns à la XSLT will be 
available in that filters, but the memory will be freed as one goes along.

Moreover, when a pattern matches, XPath expressions can be applied on 
the node that matches, and using an XPath expression that requires 
further reading is transparent.
However, the engine doesn't prevent silly things : if you apply an XPath 
expression when the root matched that consist on counting all the 
children, then all the tree will be kept in memory and you rather use a 
DOM document instead...

I wrote an article that explains how it works :
http://reflex.gforge.inria.fr/saxPatterns.html

Unlike STX, it deals with real XPath patterns, and it can also use XPath 
functions such as last() or count()

There are very few elements dedicated to XCL filters : 
<xcl:parse-filter>, <xcl:filter>, <xcl:rule>, <xcl:forward> and 
<xcl:apply-rules/> ; other elements such as those that can create an 
element or update an attribute are not specific to XCL filters and were 
designed before for another purpose ; you can also use foreign elements 
from other modules, and of course litterals elements like with XSLT

Here are some use cases :
http://reflex.gforge.inria.fr/tests/xunit/reflex/xcl-filters/use-cases-filter.xcl
(sorry, it is not well-indented)
The input :
http://reflex.gforge.inria.fr/tests/xunit/reflex/xcl-filters/use-cases-in.xml
The output :
http://reflex.gforge.inria.fr/tests/xunit/reflex/xcl-filters/use-cases-out.xml

Additionally, some built-in filters are available :
-one that fires SAX character() events for each line read in a plain 
text input
-one that tokenize a plain text input with a regular expression
-one that process XInclusion

-- 
Cordialement,

               ///
              (. .)
  --------ooO--(_)--Ooo--------
|      Philippe Poulard       |
  -----------------------------
  http://reflex.gforge.inria.fr/
        Have the RefleX !


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]


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.