[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: 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 : 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 !
[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! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|