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




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