← Prev in month ← Prev in thread
Next in thread → Next in month →

Re: Using MathML XSL Stylesheets with XHTML and HtmlHelp

From
<>
Date
2008-11-01T18:21:02+00:00
ID
Thread
Re: Using MathML XSL Stylesheets with XHTML and HtmlHelp
All,

Attached are the files that I used to test the MathML XSL 
stylesheets with.

 

I want to emphasize that this solution only adds value to the browsers that 
do not natively support MathML. I tested this with IE7 and HtmlHelp 4.42 under 
Windows. You may have to rename the xml output file to xhtml under IE6 
(untested). 

 

I also tested the following browsers under Linux but most of them natively 
support the MathML:

 

Konquerer 3.5.9 does not use MathML at all even with the XSL 
stylesheets.

FF 3 (native)

Epiphany 2.22 (native)

Opera 9.62 (native)

Sea Monkey 1.1.12 (native)

 

There were no visual differences between the XSL based MathML and native 
MathML under the browsers that natively supported MathML. I think that the 
native solution takes precedence over the XSL.

 

I have two forms of the output: one with the XSL stylesheet line in the 
file one without. Please test on your browser.

 

Regards 

Dean Nelson

 

 

 

In a message dated 10/31/2008 4:08:17 P.M. Pacific Daylight Time, 
DeanNelson writes:

  
All,

  
After much testing and many conversations on this maillist, I have MathML 
  working for XHTML (on IE) and HtmlHelp. I used the XSL MathML stylesheets from 
  W3Cso I did not have to deal with Java or JavaScript plug-ins. This solution 
  is primarily XSL based using the Docbook XSL 1.74. I used XSLTProc as a 
  processor, but I also tested it with Saxon 6.5.5.

  
 

  
This solution was prompted by the fact that HtmlHelp uses IE for 
  rendering. IE does not natively support MathML like Mozilla does. If you are 
  using Mozilla, you do not have to use this method - Mozilla will just ignore 
  it anyway. However, if you want to have a broader audience of browsers without 
  relying on a particular plug-in, this solution may work for you.

  

  
 

  
Please let me know if you have any comments.

  
 

  
Regards,

  
Dean Nelson

  
 

  
--------------------------------------

  
Preparation

  
Download the XSL stylesheets for MathML (http://www.w3.org/Math/XSL/xsl.zip) 
  as mentioned in the http://www.w3.org/Math/XSL/Overview-tech.html document.

  
 

  
MathML/XHTML on Internet Explorer

  
To get the MathML rendered with the XSL stylesheets, XHTML must be used. 
  The following changes need to be made to the Docbook customization layer and 
  processing.

  
 

  
1. Add the MathML stylesheet via the  "user.preroot" template:

  
 

  
<xsl:template name="user.preroot">
  
  <xsl:processing-instruction 
  name="xml-stylesheet">
     
  <xsl:text>type="text/xsl" href="mathml.xsl"</xsl:text>
  
  </xsl:processing-instruction>
</xsl:template>

  
This lets the browser know that you have an XSL stylesheet that 
  you want to use. In this case, the mathml.xsl stylesheet from W3C. 

  
 

  
2. Make the output extension type XML

  
 

  
<xsl:param name="html.ext">.xml</xsl:param>

  
 

  
MathML will only work with an XML file in Internet Explorer.

  
 

  
3. Copy the MathML XSL stylesheets to the same directory as the output 
  file (for convenience of reference). You can place it in a directory and 
  adjust the path and filename in step 1, if required.

  

 

  
HtmlHelp 

  
 

  

  
1. Add the stylesheet via the  user.preroot parameter:

  
 

  
<xsl:template name="user.preroot">
  
  <xsl:processing-instruction 
  name="xml-stylesheet">
     
  <xsl:text>type="text/xsl" href="mathml.xsl"</xsl:text>
  
  </xsl:processing-instruction>
</xsl:template>

  

  
This lets the browser know that you have an XSL stylesheet that 
  you want to use. In this case, the mathml.xsl stylesheet from 
  W3C. 
 

  
2. Make the output extension type XML

  
 

  
<xsl:param name="html.ext">.htm.xml</xsl:param>

  
 

  
HtmlHelp needs a file extension to start with ".h".

  
3. Copy the MathML XSL stylesheets to the same directory as the output 
  file.

  
 

  
4. Add additional chunking parameters. This is because the stock HTMLHELP 
  stylesheets do not emit XML declarations.

  
 

  
<xsl:param name="chunker.output.doctype-public">-//W3C//DTD XHTML 
  1.0 Transitional//EN</xsl:param>
<xsl:param 
  name="chunker.output.doctype-system">http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd</xsl:param>
<xsl:param 
  name="chunker.output.omit-xml-declaration">no</xsl:param>
<xsl:param 
  name="chunker.output.method">xml</xsl:param>
<xsl:param 
  name="chunker.output.indent">yes</xsl:param>
<xsl:param 
  name="chunker.output.standalone">no</xsl:param>
<xsl:param 
  name="chunker.output.encoding">UTF-8</xsl:param>  (or whatever 
  locale setting you need)

  
 

  
 

  
5. Adjust/add the stylesheets to the tail of HELP.

  
 

  
 <xsl:param 
  name="htmlhelp.hhp.tail"> mathml.xsl
   
  ctop.xsl
   pmathml.xsl
  
   pmathmlcss.xsl
 </xsl:param>

  
 

  
This is also a good place to add any CSS stylesheets that you are 
  using.

  
6. Process the HtmlHelp and ignore the messages that say "HHC3004: 
  Warning: toc.hhc : The HTML tag "?xml version="1.0" encoding="iso-8859-1" 
  standalon..." is not a valid HTML tag (it does not begin with an alphanumeric 
  character)."

  
 

  
-----------------------------

  

  
  Plan your next getaway with AOL Travel. Check 
  out Today's Hot 5 Travel 
Deals!

Plan your next getaway with AOL Travel.  Check out Today's Hot 5 Travel Deals!

mathml-test.zip
← Prev in month ← Prev in thread
Next in thread → Next in month →