ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* \xmlchainatt behaviour
@ 2016-11-11 16:43 Meer, Hans van der
  0 siblings, 0 replies; only message in thread
From: Meer, Hans van der @ 2016-11-11 16:43 UTC (permalink / raw)
  To: NTG ConTeXt


[-- Attachment #1.1: Type: text/plain, Size: 1727 bytes --]

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





[-- Attachment #1.2: Type: text/html, Size: 2760 bytes --]

[-- Attachment #2: xml-tex-chainattribute.pdf --]
[-- Type: application/pdf, Size: 12401 bytes --]

[-- Attachment #3: Type: text/plain, Size: 492 bytes --]

___________________________________________________________________________________
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://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki     : http://contextgarden.net
___________________________________________________________________________________

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-11-11 16:43 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-11 16:43 \xmlchainatt behaviour Meer, Hans van der

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).