[NTG-context] \xmlchainatt behaviour

Meer, Hans van der H.vanderMeer at uva.nl
Fri Nov 11 17:43:12 CET 2016


I might be doing wrong, but for now I have the strong impression that \xmlchainatt is at fault. It does not break the callchain as soon as a match is found.
Also according the manual xml-mkiv, \xmlchainatt{#1}{testx}{no-test} should return "no-test" but returns nothing. I would very much helped if these macros react is I thin they should.
Is this my fault?

Hans van der Meer

Minimal example

% test chainttribute failure.
\startxmlsetups demo:chainatt
        \xmlsetsetup{#1}{root|node|innernode}{demo:chainatt:*}
\stopxmlsetups
\xmlregisterdocumentsetup{demo}{demo:chainatt}
\startxmlsetups demo:chainatt:root
        root: xmlatt <test> = <\xmlatt{#1}{test}>\crlf
        root: xmlchainatt <test> = <\xmlchainatt{#1}{test}>\crlf
        \xmlall{#1}{*}
\stopxmlsetups
\startxmlsetups demo:chainatt:node
        -- node: xmlatt test = <\xmlatt{#1}{test}>\crlf
        -- node: xmlchainatt <node> = \xmlchainatt{#1}{test}\crlf
        -- node: xmlchainattdef <node> = \xmlchainattdef{#1}{notest}{no-test}\crlf

\stopxmlsetups
\startxmlsetups demo:chainatt:innernode
        ---- innernode: xmlatt test = <\xmlattdef{#1}{test}{nono}>\crlf
        ---- innernode: xmlchainatt <test> = \xmlchainatt{#1}{test}\crlf
\stopxmlsetups
\startbuffer[chainatt]
<root test="abc">
  <node test="pqr">
    <innernode test="xyz"/>
  </node>
</root>
\stopbuffer
\starttext
\ConTeXt-version=\contextversion\blank
Manual on xml-mkiv page 22 on \tex{xmlchainatt} reads:
returns the value of attribute NAME or empty if no such attribute exists; backtracks till a match is found\blank
\xmlprocessbuffer{demo}{chainatt}{}\blank
However, does not stop when backtracking finds "a match".
\stoptext




-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20161111/50d63208/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: xml-tex-chainattribute.pdf
Type: application/pdf
Size: 12401 bytes
Desc: xml-tex-chainattribute.pdf
URL: <http://mailman.ntg.nl/pipermail/ntg-context/attachments/20161111/50d63208/attachment.pdf>


More information about the ntg-context mailing list