OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index]
Re: [xml-dev] Disk-based XPath Processing

Michael Kay wrote:
> There are lots of academic papers on streaming XPath that have implemented
> the parts of XPath that the researchers knew how to implement and left out
> the bits they didn't (such is the privilege of academics). They aren't all
> very good at revealing which bits they left out, but I don't think you'll
> find one that can do preceding-sibling::*[3] or
> following-sibling::*[last()-1].
> Michael Kay
> http://www.saxonica.com/

Hi Michael,

The steps of XSLT patterns are restricted to child or @ axes, thus I 
guess that you're talking about finding following-sibling::*[last()-1] 
inside a predicate...
As I said previously, RefleX is somewhat good as long as you don't use 
reverse axes ; XCL filters can handle such expressions : 

For XPath expressions that are not used as patterns, or predicates of 
patterns that would use a reverse axe, you might consider an alternative 
strategy, for example by pouring a SAX subtree to a DOM fragment ; with 
RefleX, it would be something like this :

<xcl:rule pattern="foo">
     <xcl:document name="myDOM">
         { . }
     <xcl:if test="{$myDOM/someNode/preceding-sibling::*[3]}">
            <!--do what you want here-->

But in both cases, it means that you are implicitely or explicitely 
caching datas, so it is efficient for small subtrees. Be aware of the 
consequences of your XPath patterns or expressions when they are applied 
to SAX streams.

To conclude, I'm sure that it's better to get round rather than trying 
to get a straight solution hard to accomplish with SAX.


              (. .)
|      Philippe Poulard       |
        Have the RefleX !

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

News | XML in Industry | Calendar | XML Registry
Marketplace | Resources | MyXML.org | Sponsors | Privacy Statement

Copyright 1993-2007 XML.org. This site is hosted by OASIS