OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.

 


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]


Subject: Re: [docbook-apps] Docbook5.0b4 mathml xsltproc fop


I'm not sure what you are expecting, but fop 0.20.5 does not 
support MathML processing.  The stylesheet just passes MathML 
content through, on the assumption that the downstream processor 
can typeset it in some way.  But fop cannot process it, and 
indicates so in the error messages.

You can preprocess your math into an SVG image, and use a 
mediaobject inside your informalequation to reference the SVG 
file.

Bob Stayton
Sagehill Enterprises
DocBook Consulting
bobs@sagehill.net


----- Original Message ----- 
From: "Bruno GUEGAN" <bruno_guegan@yahoo.fr>
To: <docbook-apps@lists.oasis-open.org>
Sent: Thursday, March 23, 2006 6:49 PM
Subject: [docbook-apps] Docbook5.0b4 mathml xsltproc fop


> Hello,
>
> I used xmllint to validate the file howto.xml (resulting from 
> documentation on
> docbook5.0) in which I put tags mathml.
>
> $ xmllint --noout --relaxng 
> ../libs/docbook-5.0b4/custom_rng.rng howto.xml
> howto.xml validates
> $
>
> $ cat ../libs/docbook-5.0b4/custom_rng.rng
> <?xml version="1.0" encoding="UTF-8"?>
> <grammar xmlns="http://relaxng.org/ns/structure/1.0";>
>
> <include href="rng/docbook.rng">
>  <define name="db._any.mml">
>    <externalRef href="mathml/mathml2.rng"/>
>  </define>
>
>  <define name="db._any.svg">
>    <externalRef href="svg1.1/svg11.rng"/>
>  </define>
>
>  <define name="db._any">
>    <element>
>      <anyName>
>        <except>
>          <nsName ns="http://docbook.org/ns/docbook"/>
>          <nsName ns="http://www.w3.org/1999/xhtml"/>
>          <nsName ns="http://www.w3.org/1998/Math/MathML"/>
>          <nsName ns="http://www.w3.org/2000/svg"/>
>        </except>
>      </anyName>
>      <zeroOrMore>
>        <choice>
>          <attribute>
>            <anyName/>
>          </attribute>
>          <text/>
>          <ref name="db._any"/>
>        </choice>
>      </zeroOrMore>
>    </element>
>  </define>
> </include>
>
> </grammar>
>
> Now, I seek to transform this document howto.xml to obtain HTML 
> with xsltproc.
> $ xsltproc -V
> Using libxml 20623, libxslt 10115-CVS1043 and libexslt 
> 812-CVS1043
> xsltproc was compiled against libxml 20623, libxslt 10115 and 
> libexslt 812
> libxslt 10115 was compiled against libxml 20623
> libexslt 812 was compiled against libxml 20623
> $
>
> $ xsltproc -o /tmp/howto.html 
> ../libs/docbook-xsl-1.69.1/html/docbook.xsl
> howto.xml
> Stripping NS from DocBook 5/NG document.
> Processing stripped document.
> $
>
> The result (a part of document) exactly like that :
> A MathML formula can be typeset inline, as here  E=mc 2 , 
> Einstein's famous
> equation.
> A =    x y   z w     .
>
> There is no exit with mathematical characters. A : is a matrix 
> ... Like this :
> <para>
> <informalequation>
>    <mml:math xmlns:mml="http://www.w3.org/1998/Math/MathML";>
>    <mml:mrow>
>      <mml:mi>A</mml:mi>
>      <mml:mo>=</mml:mo>
>      <mml:mfenced open="[" close="]">
>        <mml:mtable><!-- table or matrix -->
>          <mml:mtr> <!-- row in a table  -->
>             <mml:mtd><mml:mi>x</mml:mi></mml:mtd><!-- table -->
>             <mml:mtd><mml:mi>y</mml:mi></mml:mtd><!-- entry -->
>          </mml:mtr>
>          <mml:mtr>
>             <mml:mtd><mml:mi>z</mml:mi></mml:mtd>
>             <mml:mtd><mml:mi>w</mml:mi></mml:mtd>
>          </mml:mtr>
>        </mml:mtable>
>      </mml:mfenced>
>     </mml:mrow>
>    <mml:mtext>.</mml:mtext>
>    </mml:math>
>    </informalequation>
> </para>
>
> For the pdf (fop 0.20.5-8) :
> $ xsltproc -o /tmp/howto.fo 
> ../libs/docbook-xsl-1.69.1/fo/docbook.xsl
> howto.xml
> Making portrait pages on USletter paper (8.5inx11in)
> XPath error : Invalid context position
> xmlXPathCompiledEval: evaluation failed
> $
>
> $ fop -fo /tmp/howto.fo -pdf /tmp/howto.pdf
> ....
> [ERROR] Unsupported element encountered: math (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 11, col: 276)
> [ERROR] Expected XSL-FO (root, page-sequence, etc.), SVG (svg, 
> rect, etc.) or
> elements from another supported language.
> [ERROR] Unsupported element encountered: mn (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 12, col: 12)
> [ERROR] Unsupported element encountered: mi (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 17, col: 9)
> [ERROR] Unsupported element encountered: mo (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 17, col: 27)
> [ERROR] Unsupported element encountered: msup (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 17, col: 65)
> [ERROR] Unsupported element encountered: mrow (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 22, col: 15)
> [ERROR] Unsupported element encountered: mfenced (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 25, col: 39)
> [ERROR] Unsupported element encountered: mtable (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 26, col: 21)
> [ERROR] Unsupported element encountered: mtr (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 27, col: 20)
> [ERROR] Unsupported element encountered: mtd (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 28, col: 23)
> [ERROR] Unsupported element encountered: mtext (Namespace:
> http://www.w3.org/1998/Math/MathML). Source context: 
> file:/tmp/howto.fo
> (line: 38, col: 16)
> ....
> $
>
> Finally the file catalog :
> $ echo $XML_CATALOG_FILES
> /home/bruno/Travail/DocBook5.0/libs/docbook-xsl-1.69.1/catalog.xml 
> /etc/xml/catalog
>
> Could you help me to obtain a correct exit?
>
> Best regards,
> Bruno
> -- 
> Le contraire est utile. Des opposés sort le plus beau concert. 
> De la discorde
> tout est né.
> Héraclite
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: 
> docbook-apps-unsubscribe@lists.oasis-open.org
> For additional commands, e-mail: 
> docbook-apps-help@lists.oasis-open.org
>
>
> 




[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]