Hi, I tried to get the following example with ConTeXt's old XML macros in MkII with the new setup mechanism from MkIV. \defineXMLenvironment [section] {Section:\par} {} \defineXMLenvironment [p] \par \par \startbuffer <section> <p>text text</p> <section> <p>text text</p> </section> <p>text text</p> </section> \stopbuffer \starttext \processXMLbuffer \stoptext My code for MkIV looks like: \startxmlsetups xml:mysetups \xmlsetsetup{\xmldocument}{section}{xml:section} \xmlsetsetup{\xmldocument}{p}{xml:paragraph} \stopxmlsetups \xmlregistersetup{xml:mysetups} \startxmlsetups xml:paragraph \xmlflush{#1}\par \stopxmlsetups \startxmlsetups xml:section Section:\par \xmlflush{#1} \stopxmlsetups \startbuffer[section] <section> <p>text text</p> <section> <p>text text</p> </section> <p>text text</p> </section> \stopbuffer \starttext \xmlprocessbuffer{main}{section}{} \stoptext What I want is to insert or execute a macro at the begin of every new section environment (I used the text "Section:") and this work fine with XML definition but not with setups, only the first envionment is executed and the rest is only read and flushed. Wolfgang
Wolfgang Schuster wrote:
What I want is to insert or execute a macro at the begin of every new section environment (I used the text "Section:") and this work fine with XML definition but not with setups, only the first envionment is executed and the rest is only read and flushed.
smells like a bug btw, \xmlsetsetup{\xmldocument}{p|section}{xml:*} is more efficient (one sweep) ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com | www.pragma-pod.nl -----------------------------------------------------------------
participants (2)
-
Hans Hagen
-
Wolfgang Schuster