Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


Re: [xml-dev] Disk-based XPath Processing

From: Philippe Poulard <Philippe.Poulard@------.-----.-->
To: Michael Kay <mike@--------.--->
Date: 10/3/2006 12:18:00 PM
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 : 
foo[following-sibling::*[last()-1]]

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:document>
     <xcl:if test="{$myDOM/someNode/preceding-sibling::*[3]}">
        <xcl:then>
            <!--do what you want here-->
        </xcl:then>
     </xcl:if>
</xcl:rule>

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.

-- 
Cordialement,

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


transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent