[
Lists Home |
Date Index |
Thread Index
]
Alan Gutierrez wrote:
>
>
> To match that partuclar end element, with that partucular
> pattern, you only need to update a state machine as the events
> stream by. There's no need to traverse at end element. The
> pattern matches and an event handler takes over the stream.
>
> <foo>
> <bar>one</bar>
> <baz>
> <a><b><c>two</c></b></a>
> </baz>
> <bar>three</bar>
> </foo>
>
> /foo[baz/a/b/c = 'two']/bar[. = 'three']
>
> I can know that the above pattern matches at the end of the last
> bar, without keeping any nodes at all.
>
>
I see. This way could be inconvenient if you have a lot of patterns and
you don't know which of them will be tested in the beginning. Keeping
some info for later evaluation or updating the state machine are
different implementation approaches, XPattern should work for both.
Anyway, I see why you refuse starting with context definition. Let's
work with EBNF then.
BTW, I think XPattern should be a subset of XSLT pattern
(http://www.w3.org/TR/xslt20/#NT-Pattern) rather than XPath expression.
--
Petr Cimprich
Ginger Alliance
www.gingerall.com
|