This one took the better part of an afternoon from me, but I finally found the 
(unexpected) culprit.
In the xml documentation on page 31 it is said:
 The given expression between [] is converted to a LUA expression so you can 
use the use operators: == ~= <= >= < > not and or ()
In addition, = equals == and != is the same as ~=.

This is not true as the following demonstrates. The use of != is as expected 
but the ~= leads to an error and this should not be:

xml> lpath > error in expression: number(@atta) ~= 1 => 
expr.number((ll.at<http://ll.at> and ll.at<http://ll.at>['atta'])) ~== 1


Hans van der Meer


% failure of test on inequality.
\startxmlsetups demo:comparefail
\xmlsetsetup{#1}{root|node}{demo:comparefail:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{demo:comparefail}
\startxmlsetups demo:comparefail:root
compare \type{!=}\crlf
\xmlfilter{#1}{/[number(@atta) != 1]/command(demo:comparefail:node)}
compare \type{~=}\crlf
\xmlfilter{#1}{/[number(@atta) ~= 1]/command(demo:comparefail:node)}
\stopxmlsetups
\startxmlsetups demo:comparefail:node
node: attribute atta = \xmlatt{#1}{atta}\crlf
\stopxmlsetups
\startbuffer[comparefail]
<root>
<node atta="2"/>
<node atta="1"/>
</root>
\stopbuffer
\starttext
\xmlprocessbuffer{demo}{comparefail}{}
Note the absence of output in the second \tex{xmlfilter}.
\stoptext

Attachment: xml-compare.pdf
Description: xml-compare.pdf

___________________________________________________________________________________
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://tex.aanhet.net
archive  : http://foundry.supelec.fr/projects/contextrev/
wiki     : http://contextgarden.net
___________________________________________________________________________________

Reply via email to