[NTG-context] XML/MathML namespace handling bug

Hans Hagen j.hagen at xs4all.nl
Sun Mar 21 03:06:46 CET 2021


On 3/20/2021 10:52 PM, Hugo Landau wrote:
> Thanks for ConTeXt, it is an amazing system.
> 
> The following test case demonstrates the bug.
> 
>    \usemodule[mathml]
>    \starttext
>    \xmlprocessdata{}{
>    <?xml version="1.0" encoding="utf-8"?>
>    <foo xmlns="http://www.example.com/ns/foo" xmlns:m="http://www.w3.org/1998/Math/MathML">
>    <m:math version="2.0">
>      <m:apply><m:union/><m:ci>a</m:ci><m:ci>b</m:ci></m:apply>
>    </m:math>
>    <m:math version="2.0">
>      <m:apply><m:selector/><m:ci>a</m:ci><m:ci>b</m:ci></m:apply>
>    </m:math>
>    </foo>
>    }{}
>    \stoptext
> 
> No output is produced. This has been verified with live.contextgarden.net.
> 
> In order for output to be produced, <m:union/> must be changed to <union> and
> <m:selector/> must be changed to <selector/>, but these are in the wrong
> namespace in this context. In other words, this bug applies to the keyword
> element in an apply element.
in x-math.mkiv search for

    \startxmlsetups mml:apply

and replace this bit:

             \edef\mmlapplyaction{\xmlfilter{#1}{/*/tag()}}
             \doifelsesetups {mml:apply:mml:\mmlapplyaction} {
                 \xmlsetup{#1}{mml:apply:mml:\mmlapplyaction}
              } {
                 \xmlsetup{#1}{mml:\mmlapplyaction}
              }

(btw, isn't content mathml more fun than presentation mathml?)

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
-----------------------------------------------------------------


More information about the ntg-context mailing list