ntg-context - mailing list for ConTeXt users
 help / color / mirror / Atom feed
* open math
@ 2006-05-18 20:02 Hans Hagen
  2006-05-19 20:25 ` nico
  0 siblings, 1 reply; 6+ messages in thread
From: Hans Hagen @ 2006-05-18 20:02 UTC (permalink / raw)


Hi,

For those interested in mathml/openmath ... i've added some support for 
openmath -> mathml conversion to the distribution (there is some stuff 
in the manual svn repos as well). I dunno how many of you actually have 
used openmath. Anyhow, it makes a nice demo of applying ctx job 
description files (used for automatic preprocessing of the xml files to 
content mathml and such).

http://www.pragma-ade.com/general/manuals/mmoexamp.pdf

Hans  

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: open math
  2006-05-18 20:02 open math Hans Hagen
@ 2006-05-19 20:25 ` nico
  2006-05-19 20:30   ` Hans Hagen
  0 siblings, 1 reply; 6+ messages in thread
From: nico @ 2006-05-19 20:25 UTC (permalink / raw)


On Thu, 18 May 2006 22:02:03 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> Hi,
>
> For those interested in mathml/openmath ... i've added some support for
> openmath -> mathml conversion to the distribution (there is some stuff
> in the manual svn repos as well). I dunno how many of you actually have
> used openmath. Anyhow, it makes a nice demo of applying ctx job
> description files (used for automatic preprocessing of the xml files to
> content mathml and such).

Just a question about the ctx file as described in the doc: does it mean  
that every XML file is processed first by 'openmath' and then 'mathadore'?

If so, why not using the xsltproc piping, avoiding the intermediate .om  
files?

Regards,
BG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: open math
  2006-05-19 20:25 ` nico
@ 2006-05-19 20:30   ` Hans Hagen
  2006-05-19 21:27     ` nico
  2006-05-19 22:30     ` nico
  0 siblings, 2 replies; 6+ messages in thread
From: Hans Hagen @ 2006-05-19 20:30 UTC (permalink / raw)


nico wrote:
> On Thu, 18 May 2006 22:02:03 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>   
>> Hi,
>>
>> For those interested in mathml/openmath ... i've added some support for
>> openmath -> mathml conversion to the distribution (there is some stuff
>> in the manual svn repos as well). I dunno how many of you actually have
>> used openmath. Anyhow, it makes a nice demo of applying ctx job
>> description files (used for automatic preprocessing of the xml files to
>> content mathml and such).
>>     
>
> Just a question about the ctx file as described in the doc: does it mean  
> that every XML file is processed first by 'openmath' and then 'mathadore'?
>
> If so, why not using the xsltproc piping, avoiding the intermediate .om  
> files?
>   
i'm not aware of piping ... how does the command look then? 

Hans 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: open math
  2006-05-19 20:30   ` Hans Hagen
@ 2006-05-19 21:27     ` nico
  2006-05-21 17:35       ` Hans Hagen
  2006-05-19 22:30     ` nico
  1 sibling, 1 reply; 6+ messages in thread
From: nico @ 2006-05-19 21:27 UTC (permalink / raw)


On Fri, 19 May 2006 22:30:20 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> nico wrote:
>> On Thu, 18 May 2006 22:02:03 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>
>>> Hi,
>>>
>>> For those interested in mathml/openmath ... i've added some support for
>>> openmath -> mathml conversion to the distribution (there is some stuff
>>> in the manual svn repos as well). I dunno how many of you actually have
>>> used openmath. Anyhow, it makes a nice demo of applying ctx job
>>> description files (used for automatic preprocessing of the xml files to
>>> content mathml and such).
>>
>> Just a question about the ctx file as described in the doc: does it mean
>> that every XML file is processed first by 'openmath' and then  
>> 'mathadore'?
>>
>> If so, why not using the xsltproc piping, avoiding the intermediate .om
>> files?
>>
> i'm not aware of piping ... how does the command look then?

Provided that it's possible to pipe commands via ctx and/or texexec:

xsltproc x-sm2om.xsl foo.xml | xsltproc -o foo.prep x-openmath.xsl -

Regards,
BG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: open math
  2006-05-19 20:30   ` Hans Hagen
  2006-05-19 21:27     ` nico
@ 2006-05-19 22:30     ` nico
  1 sibling, 0 replies; 6+ messages in thread
From: nico @ 2006-05-19 22:30 UTC (permalink / raw)


On Fri, 19 May 2006 22:30:20 +0200, Hans Hagen <pragma@wxs.nl> wrote:

> nico wrote:
>> On Thu, 18 May 2006 22:02:03 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>
>> Just a question about the ctx file as described in the doc: does it mean
>> that every XML file is processed first by 'openmath' and then  
>> 'mathadore'?
>>
>> If so, why not using the xsltproc piping, avoiding the intermediate .om
>> files?
>>
> i'm not aware of piping ... how does the command look then?

Thinking a bit about this, you could avoid using two passes, by merging  
both stylesheets. The only limitation is the need of the node-set EXSL  
function (but available in xsltproc by default).

Simple example:

The main stylesheet (say, x-openmath.xsl):

<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                 xmlns:exsl="http://exslt.org/common"
                 exclude-result-prefixes="exsl"
                 version='1.0'>

<xsl:import href="x-sm2om.xsl"/>
<xsl:import href="x-om2cml.xsl"/>

<xsl:template match="i|n">
   <xsl:variable name="om">
     <xsl:apply-imports select="."/>
   </xsl:variable>
   <xsl:apply-templates select="exsl:node-set($om)"/>
</xsl:template>

</xsl:stylesheet>

The imported ones:

x-sm2om.xsl
-----------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>

<xsl:template match="i|n">
    <xsl:element name="OMOBJ">
       <xsl:attribute  
name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
       <xsl:attribute name="version">2.0</xsl:attribute>
       <xsl:value-of select="text()"/>
    </xsl:element>
</xsl:template>

</xsl:stylesheet>

x-om2cml.xsl
------------
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"  
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml"/>

<xsl:template match="OMOBJ">
   <xsl:element name="cn">
     <xsl:attribute  
name="xmlns">http://www.openmath.org/OpenMath</xsl:attribute>
     <xsl:attribute name="version">2.0</xsl:attribute>
     <xsl:value-of select="text()"/>
   </xsl:element>
</xsl:template>

</xsl:stylesheet>

XML file
---------
<example>
<i>a</i>
<i>b</i>
<i>c</i>
<n>d</n>
<i>e</i>
</example>

xsltproc x-openmath.xsl example.xml


It should be checked on the real stylesheets, but it should work. It's  
nicer than piping commands, and should take less time to process.

Regards,
BG

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: open math
  2006-05-19 21:27     ` nico
@ 2006-05-21 17:35       ` Hans Hagen
  0 siblings, 0 replies; 6+ messages in thread
From: Hans Hagen @ 2006-05-21 17:35 UTC (permalink / raw)


nico wrote:
> On Fri, 19 May 2006 22:30:20 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>
>   
>> nico wrote:
>>     
>>> On Thu, 18 May 2006 22:02:03 +0200, Hans Hagen <pragma@wxs.nl> wrote:
>>>
>>>       
>>>> Hi,
>>>>
>>>> For those interested in mathml/openmath ... i've added some support for
>>>> openmath -> mathml conversion to the distribution (there is some stuff
>>>> in the manual svn repos as well). I dunno how many of you actually have
>>>> used openmath. Anyhow, it makes a nice demo of applying ctx job
>>>> description files (used for automatic preprocessing of the xml files to
>>>> content mathml and such).
>>>>         
>>> Just a question about the ctx file as described in the doc: does it mean
>>> that every XML file is processed first by 'openmath' and then  
>>> 'mathadore'?
>>>
>>> If so, why not using the xsltproc piping, avoiding the intermediate .om
>>> files?
>>>
>>>       
>> i'm not aware of piping ... how does the command look then?
>>     
>
> Provided that it's possible to pipe commands via ctx and/or texexec:
>
> xsltproc x-sm2om.xsl foo.xml | xsltproc -o foo.prep x-openmath.xsl -
>   
ah, that way; i thought that you meant that xsltproc had a sequencing 
option

the piping could indeed be a problem so it needs some testing

Hans

-- 

-----------------------------------------------------------------
                                          Hans Hagen | PRAGMA ADE
              Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
     tel: 038 477 53 69 | fax: 038 477 53 74 | www.pragma-ade.com
                                             | www.pragma-pod.nl
-----------------------------------------------------------------

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-05-21 17:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-05-18 20:02 open math Hans Hagen
2006-05-19 20:25 ` nico
2006-05-19 20:30   ` Hans Hagen
2006-05-19 21:27     ` nico
2006-05-21 17:35       ` Hans Hagen
2006-05-19 22:30     ` nico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).