[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]
Re: [xml-dev] SGML complexity
- From: Philippe Poulard <Philippe.Poulard@sophia.inria.fr>
- To: juanrgonzaleza@canonicalscience.com
- Date: Fri, 08 Sep 2006 17:22:59 +0200
juanrgonzaleza@canonicalscience.com wrote:
> Philippe Poulard said:
>
>>juanrgonzaleza@canonicalscience.com wrote:
>>
>>>transforming this
>>>
>>><math code="LaTeX">x = \frac{-b \pm \sqrt{b^2 - 4ac}}{2a}</math>
>>>
>>>to this
>>>
>>><math>
>>> <mi>x</mi>
>>> <mo>=</mo>
>>> <mfrac>
>>> <mrow>
>>> <mrow>
>>> <mo>-</mo>
>>> <mi>b</mi>
>>> </mrow>
>>> <mo>±</mo>
>>> <msqrt>
>>> <msup>
>>> <mi>b</mi>
>>> <mn>2</mn>
>>> </msup>
>>> <mo>-</mo>
>>> <mrow>
>>> <mn>4</mn>
>>> <mo>⁢</mo>
>>> <mi>a</mi>
>>> <mo>⁢</mo>
>>> <mi>c</mi>
>>> </mrow>
>>> </msqrt>
>>> </mrow>
>>> <mrow>
>>> <mn>2</mn>
>>> <mo>⁢</mo>
>>> <mi>a</mi>
>>> </mrow>
>>> </mfrac>
>>></math>
>>>
>>>can be a nightmare in XSLT 1 (specially when compared with JS-DOM or
>>>PHP methods). I do not know of XSLT 2 new capabilities but Mike here
>>>could say us something.
>>>
>>
>>If I had such a transformation to perform, I would simply do it like
>>this : <xsl:template match="math[code='LaTeX'"]>
>> <xsl:value-of select="lib:latex2mathml( . )"/>
>><xsl:template>
>>or even if you don't know how to bind a function library to your XSLT
>>processor :
>><xsl:template match="math[code='LaTeX'"]>
>> <xsl:value-of select="document( concat(
>>'http://my.rest.service/latex/2/mathml?code=', . ) )"/>
>><xsl:template>
>
>
> And sure i can also reference a .js from the XSLT and final doc is
> transformed to mathml ouput on the fly.
I'm not sure that client side Javascript is also the best language to
parse LaTeX and create a MathML document.
>
> And sure also i could do full match pattern transforming predefined
> equations and store several billions of predefined patterns in an external
> file.
What kind of programmer would consider such an ugly idea ?
>
> And sure...
>
> But difficult to believe i was using XSLT for the transformation.
>
>
>>Nobody said that XSLT must be standalone, and I'm sure it's easy to find
>> a converter for LaTeX.
>
>
> Please point some doing _exactly_ the transformation i wrote.
Maybe your own tool ? You are telling again and again that XSLT is not
suitable for such transformation, I do really agree on this point.
Others here :
http://www.google.fr/search?hl=fr&q=latex2xml
>
>
>>As you combined some XML tags with LaTeX, why not using both tools and
>>make a smart bridge between them ?
>
>
> Combination of XML with LaTeX is common practice since MathML is too
> verbose. Several MathML tools work in that way. Combination of c-MathML
> with TeX is also defined in the MathML spec.
>
> What you mean by "make a smart bridge between them"
>
I just mean to use an external LaTeX converter from XSLT, as I suggested
in the template above.
--
Cordialement,
///
(. .)
--------ooO--(_)--Ooo--------
| Philippe Poulard |
-----------------------------
http://reflex.gforge.inria.fr/
Have the RefleX !
[Date Prev]
| [Thread Prev]
| [Thread Next]
| [Date Next]
--
[Date Index]
| [Thread Index]