On 12/14/2017 8:46 PM, Pablo Rodriguez wrote:
On 12/13/2017 10:22 AM, MF wrote:
Il giorno mar, 12/12/2017 alle 22.36 +0100, Pablo Rodriguez ha scritto:
[...] But {header, #header} shouldn’t be a problem, accorrding to http://pragma-ade.com/general/manuals/xml-mkiv.pdf#page=34.
If this isn’t a bug, I wonder what I’m doing wrong.
Could you send a minimal (not) working example?
Here you have it:
\startbuffer[demo] <doc> <header> <p>Document Title</p> <p>Text from paragraph.</p> </header> <div id="header"> <p>Document Title</p> <p>Text from paragraph.</p> </div> <div class="header"> <p>Document Title</p> <p>Text from paragraph.</p> </div> </doc> \stopbuffer
\startxmlsetups xml:initialize \xmlsetsetup{#1}{doc|p}{xml:*} \xmlsetsetup{#1}{{header}}{xml:header} \xmlsetsetup{#1}{{.header}}{xml:header:class} %~ \xmlsetsetup{#1}{{#header}}{xml:header:id} \xmlsetsetup{#1}{{id="header"}}{xml:header:id} \stopxmlsetups
\xmlregistersetup{xml:initialize}
\startxmlsetups xml:doc \xmlflush{#1} \stopxmlsetups
\startxmlsetups xml:header \startalign[left]\xmlflush{#1}\stopalign \stopxmlsetups
\startxmlsetups xml:header:class \start\em\xmlflush{#1}\stop \stopxmlsetups
\startxmlsetups xml:header:id \startalign[right]\xmlflush{#1}\stopalign \stopxmlsetups
\startxmlsetups xml:p \xmlflush{#1} \stopxmlsetups
\starttext \xmlprocessbuffer{main}{demo}{} \stoptext
.header works fine, it is only #header that breaks compiliation.
I hope Hans can fix it (or explain what I’m doing wrong). There's nothing to fix, as mentioned already # is kind of special in tex, so you need to escape it:
\xmlsetsetup{#1}{{\letterhash header}}{xml:header:id} The same is true for % : \letterpercent. Hans ----------------------------------------------------------------- Hans Hagen | PRAGMA ADE Ridderstraat 27 | 8061 GH Hasselt | The Netherlands tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl -----------------------------------------------------------------