Re: HTML5 and MathML and namespaces, oh my

"Chris Papademetrious [email protected]" <[email protected]>
Newsgroups gmane.text.xml.xsl.general.mulberrytech
Message-ID <[email protected]>
Hi Martin,

Thanks for taking the time to reply!

The :mml namespace was a vestigial declaration from earlier experiments. I didn't realize its presence would cause problems. After deleting it, I get


    ...
    <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mrow>
        <mrow xmlns="">
          <mspace xmlns="http://www.w3.org/1998/Math/MathML"/>
        </mrow>
      </mrow>
    </math>
    ...


which makes me now realize that my newly-added <mrow> was *not* in the MathML namespace as I expected. So then I added

    xmlns="http://www.w3.org/1998/Math/MathML"

to my <xsl:stylesheet> opening tag so that the unqualified <mspace> in my template was created in the MathML namespace, and now I get the expected results:


<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <title>Equations</title>
  </head>
  <body>
    <math xmlns="http://www.w3.org/1998/Math/MathML">
      <mrow>
        <mrow>
          <mspace/>
        </mrow>
      </mrow>
    </math>
  </body>
</html>


In retrospect, my mistakes were:

1. Thinking that "xpath-default-namespace" affected new element creation too.
2. Not realizing that the <mspace> created by my template was *not* in the MathML namespace.

Many thanks!!

 - Chris

--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/3329386
or by email: [email protected]
--~--
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.