Re: [xsl] HTML5 and MathML and namespaces, oh my

Subject: Re: [xsl] HTML5 and MathML and namespaces, oh my
From: "Wendell Piez wapiez@xxxxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Fri, 6 Nov 2020 14:57:53 -0000
Hi,

On Thu, Nov 5, 2020 at 10:18 PM Liam R. E. Quin liam@xxxxxxxxxxxxxxxx <
xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx> wrote:

> On Fri, 2020-11-06 at 01:13 +0000, Chris Papademetrious
> christopher.papademetrious@xxxxxxxxxxxx wrote:
> >
> >   <xsl:template xmlns="http://www.w3.org/1998/Math/MathML";
> > match="mi">
>
> i think you want,
> <xsl:template xmlns:m="http://www.w3.org/1998/Math/MathML";
> match="m:mi">
>

Alternatively,
<xsl:template xpath-default-namespace="http://www.w3.org/1998/Math/MathML";
match="mi">

which binds unprefixed names to MathML for the purposes of XPath, in the
scope of this template. Not that I would recommend doing this a lot, or
even much at all.

One takeaway is that we have the option of writing our XSLT to match using
the same prefixes on names as are used in the document(s), but we don't
have to, and indeed it is a necessary feature that we be able to assign and
use our own prefixes instead, especially when dealing with these
mixed-namespace cases.

Cheers, Wendell

-- 
...Wendell Piez... ...wendell -at- nist -dot- gov...
...wendellpiez.com... ...pellucidliterature.org... ...pausepress.org...
...github.com/wendellpiez... ...gitlab.coko.foundation/wendell...

Current Thread