[Home] [By Thread] [By Date] [Recent Entries]
Alan Gutierrez wrote: >Thinking more in terms of pattern matching, less in terms of > document traversal. > > I have no problem with this kind of thinking (as far as I can see myself :). Any streaming processing is more declarative and there is not much space for a document traversal. But still, you have to maintain some amount of information to be able to decide if a pattern matches or not. > > > <xp:capture name="foo" select="/document/reverse"/> > <xp:insert-after match="/document/reverse"> > <reversed><xp:value-of select="util::reverse($foo)"/></reversed> > </xp:insert-after> > > When you process endElement for reverse, you need to know whether its parent is document in order to decide if /document/reverse matches. This information necessary for matching is what I call "the context". Then, you could navigate through the context data with a XPattern-like language (with limited axis etc.), but this is another story. So, I'm also talking about matching patterns against a stream of events; but I just need to know what info is available to test the pattern. -- Petr Cimprich Ginger Alliance www.gingerall.com
|

Cart



