Re: [docbook-apps] Using MathML XSL Stylesheets with XHTML and HtmlHelp, again

2009-12-01 Thread DeanNelson
Magnus,
 
MathML for the HTMLHelp is really touchy. I had it working and then I fixed 
 it! Not sure what I did to make it work last year, but I can look into it. 
I  retraced my steps and came up with the same results that you did.
 
Regards,
Dean Nelson
 
 
In a message dated 12/1/2009 5:56:07 A.M. Pacific Standard Time,  
magnus.gafv...@modelon.se writes:

Hi  docbook experts!

I am struggling to get MathML to work with htmlhelp.  The only useful 
reference I found was this __ 
(http://markmail.org/thread/5kxwqwx3uihdytv2)   thread on this list, where Dean 
seems to have got this to work. Unfortunately,  repeating (at the best of my 
skills) his steps does not succeed for  me.

As described, I made a customization layer xsl (see attachment  
modelon-htmlhelp.xsl). The transformation (xsltproc with docbook xsl 1.75.2)  
passes 
fine and a set of files (index.htm.xml, ch01.htm.xml, etc) are  generated. The 
generated xml files have the head elements (before  ):


http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"_ 
(http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd) >

Compilation with MS help compiler generate the warnings described in  
Dean's post and a chm file is generated.

Now, opening  the .chm  file shows the document outline but not page 
contents.  The following  error is displayed:
The XML page cannot be displayed  
Cannot  view XML input using XSL style sheet. Please correct the error and 
then click  the _Refresh_ (javascript:location.reload())  button, or try 
again later.   

  
System  error: -2146697204. Error processing resource 
'_http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd_ 
(http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd) '.  
The same error is reported when opening index.htm.xml in IE 8. It  displays 
fine in Firefox.

I am quite new to docbook and xslt, so I may  have misinterpreted the 
instructions. Any help or hints to what is wrong would  be very much 
appreciated.

I got xhtml output to work on IE (see  attachment modelon-xhtml.xsl), using 
the header tags


http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd"_ (http://w
ww.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd) >

I also tried this dtd with htmlhelp, but without success.

Again,  I would be much grateful for any hints or help on this  matter.

/Magnus




http://www.w3.org/1999/XSL/Transform";  version="1.0">




 



http://www.w3.org/1999/XSL/Transform";  version="1.0">




-//W3C//DTD XHTML 1.1 plus 
MathML 2.0  plus SVG 1.1//EN

http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd



  



http://www.w3.org/1999/XSL/Transform";  version="1.0">








type="text/xsl"  href="mathml.xsl"



.htm.xml



-//W3C//DTD XHTML 1.0   
Transitional//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd

no
xml
yes
no
UTF-8

  mathml.xsl
ctop.xsl
pmathml.xsl
pmathmlcss.xsl




 


# Copy  this template to your docbook project directory and rename to 
Makefile.
#  Set the DOC variable to the document name (the prefix of your docbook 
xml  file, exclude the .xml  suffix):
DOCDIR=/C/JModelica.org-SDK/src/docbook/UsersGuide
DOC=JModelicaUsersGuide
DOCFILE=$(DOCDIR)/$(DOC).xml
XSLHTMLSTYLE=$(DOCBOOK_HOME)/modelon-html-IE.xsl
XSLXHTMLSTYLE=$(DOCBOOK_HOME)/modelon-xhtml.xsl
XSLPDFSTYLE=$(DOCBOOK_HOME)/modelon-fo.xsl
XSLHTMLHELPSTYLE=$(DOCBOOK_HOME)/modelon-htmlhelp.xsl

#http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html
$(DOC).xhtml:   $(DOCFILE)
xsltproc  --xinclude  --output  $@  \
$(XSLXHTMLSTYLE)  $<
mv index.html  $(DOC).xhtml

xhtml:  $(DOC).xhtml

$(DOC).html:   $(DOCFILE)
xsltproc --xinclude  --output  $@  \
$(XSLHTMLSTYLE)  $<

html:   $(DOC).html

#  http://docbook.sourceforge.net/release/xsl/current/doc/fo/index.html
$(DOC).fo:   $(DOCFILE)
rm -f $(DOC).fo
xsltproc  --xinclude  --output  $@ \
--stringparam  fop1.extensions 1 \
$(XSLPDFSTYLE)   $<

$(DOC).pdf: $(DOC).fo
cmd /c "fop -fo $<  $@"
fop -fo $< $@

pdf:   $(DOC).pdf

htmlhelp.hhp: $(DOCFILE)
xsltproc  --xinclude $(XSLHTMLHELPSTYLE) $<

htmlhelp:  $(DOC).chm

$(DOC).chm: htmlhelp.hhp
-"$(HTMLHELPWORKSHOP_HOME)/hhc" $<
mv htmlhelp.chm  $@

ifeq ($(OS),Windows_NT)
winhelp:  $(DOC).chm
else
winhelp:
endif

ifeq  ($(OS),Windows_NT)
#all: xhtml html pdf winhelp
all: htmlhelp
#all:  winhelp xhtml pdf
else
all: xhtml html  pdf
endif

clean:
rm -f *.pdf *.xhtml *.html *.fo  *.hhp *.hhc  *.chm



-
To  unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For  additional commands, e-mail:  docbook-apps-h...@lists.oasis-open.org



[docbook-apps] Using MathML XSL Stylesheets with XHTML and HtmlHelp, again

2009-12-01 Thread Magnus Gäfvert




Hi docbook experts!

I am struggling to get MathML to work with htmlhelp. The only useful
reference I found was this
 thread on this
list, where Dean seems to have got this to work. Unfortunately,
repeating (at the best of my skills) his steps does not succeed for me.

As described, I made a customization layer xsl (see
attachment modelon-htmlhelp.xsl). The transformation (xsltproc with
docbook xsl 1.75.2) passes fine and a set of files (index.htm.xml,
ch01.htm.xml, etc) are generated. The generated xml files have the head
elements (before ):

"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

Compilation with MS help compiler generate the warnings described in
Dean's post
and a chm file is generated.

Now, opening  the .chm file shows the document outline but not page
contents.  The following error is displayed:
The XML page cannot be displayed 
Cannot
view XML input using XSL style sheet. Please correct the error and then
click the Refresh
button, or try again later. 

System
error: -2146697204. Error processing resource
'http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd'.


The same error is reported when opening index.htm.xml in IE 8. It
displays fine in Firefox.

I am quite new to docbook and xslt, so I may have misinterpreted the
instructions. Any help or hints to what is wrong would be very much
appreciated.

I got xhtml output to work on IE (see attachment
modelon-xhtml.xsl), using the header tags

"http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd">

I also tried this dtd with htmlhelp, but without success.

Again, I would be much grateful for any hints or help on this matter.

/Magnus




http://www.w3.org/1999/XSL/Transform"; version="1.0">




 

http://www.w3.org/1999/XSL/Transform"; version="1.0">




-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN

http://www.w3.org/Math/DTD/mathml2/xhtml-math11-f.dtd



 

http://www.w3.org/1999/XSL/Transform"; version="1.0">








type="text/xsl" href="mathml.xsl"



.htm.xml



-//W3C//DTD XHTML 1.0  
Transitional//EN

http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd

no
xml
yes
no
UTF-8

 mathml.xsl
ctop.xsl
pmathml.xsl
pmathmlcss.xsl




 
# Copy this template to your docbook project directory and rename to Makefile.
# Set the DOC variable to the document name (the prefix of your docbook xml 
file, exclude the .xml suffix):
DOCDIR=/C/JModelica.org-SDK/src/docbook/UsersGuide
DOC=JModelicaUsersGuide
DOCFILE=$(DOCDIR)/$(DOC).xml
XSLHTMLSTYLE=$(DOCBOOK_HOME)/modelon-html-IE.xsl
XSLXHTMLSTYLE=$(DOCBOOK_HOME)/modelon-xhtml.xsl
XSLPDFSTYLE=$(DOCBOOK_HOME)/modelon-fo.xsl
XSLHTMLHELPSTYLE=$(DOCBOOK_HOME)/modelon-htmlhelp.xsl

#http://docbook.sourceforge.net/release/xsl/current/doc/html/index.html
$(DOC).xhtml:  $(DOCFILE)
xsltproc  --xinclude  --output  $@ \
$(XSLXHTMLSTYLE)  $<
mv index.html $(DOC).xhtml

xhtml:  $(DOC).xhtml

$(DOC).html:  $(DOCFILE)
xsltproc --xinclude  --output  $@ \
$(XSLHTMLSTYLE)  $<

html:  $(DOC).html

# http://docbook.sourceforge.net/release/xsl/current/doc/fo/index.html
$(DOC).fo:  $(DOCFILE)
rm -f $(DOC).fo
xsltproc --xinclude  --output  $@ \
--stringparam fop1.extensions 1 \
$(XSLPDFSTYLE)  $<

$(DOC).pdf: $(DOC).fo
cmd /c "fop -fo $< $@"
fop -fo $< $@

pdf:  $(DOC).pdf

htmlhelp.hhp: $(DOCFILE)
xsltproc --xinclude $(XSLHTMLHELPSTYLE) $<

htmlhelp: $(DOC).chm

$(DOC).chm: htmlhelp.hhp
-"$(HTMLHELPWORKSHOP_HOME)/hhc" $<
mv htmlhelp.chm $@

ifeq ($(OS),Windows_NT)
winhelp: $(DOC).chm
else
winhelp:
endif

ifeq ($(OS),Windows_NT)
#all: xhtml html pdf winhelp
all: htmlhelp
#all: winhelp xhtml pdf
else
all: xhtml html pdf
endif

clean:
rm -f *.pdf *.xhtml *.html *.fo *.hhp *.hhc *.chm

<>-
To unsubscribe, e-mail: docbook-apps-unsubscr...@lists.oasis-open.org
For additional commands, e-mail: docbook-apps-h...@lists.oasis-open.org

[docbook-apps] Using MathML XSL Stylesheets with XHTML and HtmlHelp

2008-10-31 Thread DeanNelson
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_ 
(http://www.w3.org/Math/XSL/xsl.zip) )  as mentioned in the 
_http://www.w3.org/Math/XSL/Overview-tech.html_ 
(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:
 


type="text/xsl" href="mathml.xsl"



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
 
.xml
 
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:
 


type="text/xsl" href="mathml.xsl"




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
 
.htm.xml
 
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.
 
-//W3C//DTD XHTML 1.0  
Transitional//EN
http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd
no
xml
yes
no
UTF-8  (or whatever  
locale setting you need)
 
 
5. Adjust/add the stylesheets to the tail of HELP.
 
  mathml.xsl
ctop.xsl
pmathml.xsl
pmathmlcss.xsl

 
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! 
(http://pr.atwola.com/promoclk/10075x1212416248x1200771803/aol?redir=http://travel.aol.com/discount-travel?ncid=emlcntustrav0001)