Altova Mailing List Archives>Archive Index >xml-dev Archive Home >Recent entries >Thread Prev - RE: [xml-dev] Disk-based XPath Processing >Thread Next - Re: [xml-dev] Disk-based XPath Processing Re: [xml-dev] Disk-based XPath ProcessingTo: 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 ! | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
