Re: sxpath vs txpath

[email protected] Wed, 16 May 2007 22:42:25 -0700 (PDT)
Newsgroups gmane.lisp.scheme.ssax-sxml
Message-ID <[email protected]>
> Can somebody explain what is the difference between sxpath and txpath? 
Dmitry Lizorkin would be the one to ask, but I can try too...

> Another aspect that is not fully explained in SXPAth articles is how XPath
> query that contains complicated predicate can be written in s-expression
> based presentation? For example, such query:
>
> child::a[contains(string(child::*[last()]), "abc")] . 

That seems similar to "para[5][@type='warning']" whose translation and
test is explained in the old SXPath, SSAX/lib/SXPath-old.scm. One
notable difference is that latter uses the standard SXPath predicate
equal?, whereas the original example calls for 'contains'. However,
SXPath may contain a Scheme procedure as one of the SXPath
components. That procedure receives the nodeset and can examine it in
any way, including substring search of the last node. I guess that
probably answers

> So, is the difference between sxpath and txpath included in the external
> presentation of the XPath query, or in some aspects of implementation and
> functionality?  

In SXPath, the set of predicates (query components) is open because
one may always use a Scheme procedure, a lambda form, if the standard
predicates are unsufficient or inconvenient.



-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/