[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: XPattern Specification


Re:  XPattern Specification
* Petr Cimprich <petr@g...> [2005-01-17 10:33]:
> 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.

    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.

--
Alan Gutierrez - alan@e...

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.