On 22-2-2011 8:34, Thomas A. Schmitz wrote:

> xml blob

        \xmlsetsetup{#1}{B/C/..[1]}{xml:C:first}

select all B
select all C in found B's
select first in all found



\startbuffer[test]
<A>
  <B>cat</B>
  <B><C>dog</C></B>
  <B><C>mouse</C></B>
  <B><C>donkey</C></B>
  <B>giraffe</B>
</A>
\stopbuffer

\startxmlsetups xml:testsetups
        \xmlsetsetup{#1}{A|B|C}{xml:*}
        \xmlsetsetup{#1}{B/C/..[1]}{xml:C:first}
\stopxmlsetups

\xmlregistersetup{xml:testsetups}

\startxmlsetups xml:A
        \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:B
        \xmlflush{#1}
\stopxmlsetups

\startxmlsetups xml:C:first
        \color[red]{\xmlflush{#1}}
\stopxmlsetups

\startxmlsetups xml:C
        \xmlflush{#1}
\stopxmlsetups

\starttext
    \xmlprocessbuffer{main}{test}{}
\stoptext

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
    tel: 038 477 53 69 | voip: 087 875 68 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------
___________________________________________________________________________________
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