docbook-apps

  • 1.  MathML and

    Posted 03-30-2007 07:16
    Hey,

    In order to get MathML rendered with Antenna House's XSLFormatter, you
    need to wrap all MathML blocks inside a <fo:instream-foreign-object>
    element. If I (very naively) do

    <xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <fo:instream-foreign-object>
    <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    </xsl:copy>
    </fo:instream-foreign-object>
    </xsl:template>

    I get something like this in the FO file

    <fo:instream-foreign-object xmlns:mml="http://www.w3.org/1998/Math/M
    athML"><fo:instream-foreign-object><mml:math overflow="scroll">
    <fo:instream-foreign-object><mml:mrow>
    <fo:instream-foreign-object><mml:msup>

    etc. All I wanted was to have the outer most MathML wrapped in the
    <fo:instream-foreign-object> element. This naturely puts my inane
    XSL capabilities on display, but I would still be very happy if somebody
    could point me at a solution.

    Cuurently, I use a sed command for solving the issue, but would prefer
    somthing that could go inside my cust. layer.

    All the best (and happy Easter),

    Mads

    +---------------------------------+-------------------------+
    | Mads Ipsen | |
    | Dept. of Chemistry | phone: +45-35320220 |
    | H.C.Ørsted Institute | fax: +45-35320322 |
    | Universitetsparken 5 | |
    | DK-2100 Copenhagen Ø, Denmark | mpi@osc.kiku.dk |
    +---------------------------------+-------------------------+



  • 2.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 07:43
    Mads Ipsen wrote:

    > In order to get MathML rendered with Antenna House's XSLFormatter, you
    > need to wrap all MathML blocks inside a <fo:instream-foreign-object>
    > element. If I (very naively) do

    Get the latest snapshot from http://docbook.sf.net/snapshots/
    I have fixed exactly this week or two ago.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
    ------------------------------------------------------------------
    Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html




  • 3.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 08:45
    Did you fix this:

    http://sourceforge.net/tracker/index.php?func=detail&aid=1574016&group_id=21935&atid=373749

    [ 1574016 ] docbook 5 imagedata svg and mml support

    ?

    Also, in the namespaced version of the xsl 1 stylesheets, is it now
    possible to create a version that doesn't require MathML elements to
    have a prefix?

    On 3/30/07, Jirka Kosek <jirka@kosek.cz> wrote:
    > Mads Ipsen wrote:
    >
    > > In order to get MathML rendered with Antenna House's XSLFormatter, you
    > > need to wrap all MathML blocks inside a <fo:instream-foreign-object>
    > > element. If I (very naively) do
    >
    > Get the latest snapshot from http://docbook.sf.net/snapshots/
    > I have fixed exactly this week or two ago.
    >
    > --
    > ------------------------------------------------------------------
    > Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    > ------------------------------------------------------------------
    > Professional XML consulting and training services
    > DocBook customization, custom XSLT/XSL-FO document processing
    > ------------------------------------------------------------------
    > OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
    > ------------------------------------------------------------------
    > Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html
    >
    >
    >


    --
    http://chris.chiasson.name/



  • 4.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 09:26
    Chris Chiasson wrote:
    > Did you fix this:
    >
    > http://sourceforge.net/tracker/index.php?func=detail&aid=1574016&group_id=21935&atid=373749
    >
    >
    > [ 1574016 ] docbook 5 imagedata svg and mml support
    >
    > ?

    No, I will look into this issue later, hopefully during the weekend.

    > Also, in the namespaced version of the xsl 1 stylesheets, is it now
    > possible to create a version that doesn't require MathML elements to
    > have a prefix?

    XSLT is not prefix aware, so you can use any prefix for your MathML
    elements, including using no prefix and relying on default namespace, like:




    <para>Fraction <inlineequation><math
    xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mi>n</mi></mfrac></math></inlineequation></para>


    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
    ------------------------------------------------------------------
    Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html




  • 5.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 09:31
    On 3/30/07, Jirka Kosek <jirka@kosek.cz> wrote:
    > > Also, in the namespaced version of the xsl 1 stylesheets, is it now
    > > possible to create a version that doesn't require MathML elements to
    > > have a prefix?
    >
    > XSLT is not prefix aware, so you can use any prefix for your MathML
    > elements, including using no prefix and relying on default namespace, like:
    >
    >

    >
    >
    > <para>Fraction <inlineequation><math
    > xmlns="http://www.w3.org/1998/Math/MathML"><mfrac><mn>1</mn><mi>n</mi></mfrac></math></inlineequation></para>
    >

    >

    Does this work with the current stylesheets, or is it still looking
    for elements with the mml: (or svg: ) prefix? I think the reason the
    old stylesheets needed the prefixes was that they did not use
    namespaces. Is that true?



    --
    http://chris.chiasson.name/



  • 6.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 09:35
    Chris Chiasson wrote:

    > Does this work with the current stylesheets,

    Yes, but at this time you have to download snapshot release.

    > or is it still looking
    > for elements with the mml: (or svg: ) prefix? I think the reason the
    > old stylesheets needed the prefixes was that they did not use
    > namespaces. Is that true?

    No, stylesheet can use completely different prefixes then instance.
    Matching is done on namespace name (URI). I'm probably misunderstanding
    your problem here.

    --
    ------------------------------------------------------------------
    Jirka Kosek e-mail: jirka@kosek.cz http://xmlguru.cz
    ------------------------------------------------------------------
    Professional XML consulting and training services
    DocBook customization, custom XSLT/XSL-FO document processing
    ------------------------------------------------------------------
    OASIS DocBook TC member, W3C Invited Expert, ISO/JTC1/SC34 member
    ------------------------------------------------------------------
    Want to speak at XML Prague 2007 => http://xmlprague.cz/cfp.html




  • 7.  Re: [docbook-apps] MathML and

    Posted 03-30-2007 09:57
    On 3/30/07, Jirka Kosek <jirka@kosek.cz> wrote:
    > Chris Chiasson wrote:
    >
    > > Does this work with the current stylesheets,
    >
    > Yes, but at this time you have to download snapshot release.
    >
    > > or is it still looking
    > > for elements with the mml: (or svg: ) prefix? I think the reason the
    > > old stylesheets needed the prefixes was that they did not use
    > > namespaces. Is that true?
    >
    > No, stylesheet can use completely different prefixes then instance.
    > Matching is done on namespace name (URI). I'm probably misunderstanding
    > your problem here.

    In html/math.xsl, there were some lines like this:



    <xsl:template match="mml:*" xmlns:mml="http://www.w3.org/1998/Math/MathML">
    <xsl:copy>
    <xsl:copy-of select="@*"/>
    <xsl:apply-templates/>
    </xsl:copy>
    </xsl:template>

    As far as I know, this means that MathML was only passed through if it
    had an mml: prefix. I assume this was done because of the
    non-namespaced template matching. So, is that a correct assessment? Is
    the requirement for the prefix still present?

    --
    http://chris.chiasson.name/