[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: HTML5 and MathML and namespaces, oh my

Subject: Re: HTML5 and MathML and namespaces, oh my
From: "Chris Papademetrious christopher.papademetrious@xxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Wed, 4 Nov 2020 13:04:14 -0000
Re:  HTML5 and MathML and namespaces
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.