[Om] tiny patch to CD XSLT code

Christoph Lange ch.lange at jacobs-university.de
Mon Apr 25 21:22:18 CEST 2011


Hi Dima,

Am 4/25/2011 8:24 PM, schrieb Dima:
 >    I have the following tiny patch relative to the OpenMath SVN.
 > ...

This looks like a very valuable contribution to me.  Instead of 
patching, I'd suggest to ...

@David: that you consider allowing Dima to make his changes right in the 
repository
@Paul: that you, if David approves, set the permissions accordingly.

But I myself can't do more than that.

 > The
 > patch replaces a Java call with a native XSLT2.0 function, used for
 > testing existence of a given file. The rationale is that reference
 > implementation of OpenMath standard should not assume that XSLT
 > processor is Java based. Moreover, the Java call does not work with
 > **Home Edition of Saxon** (see postscriptum).
 >
 >
 > Index: www/cdfiles2/xsl/cd.xsl
 > ===================================================================
 > --- www/cdfiles2/xsl/cd.xsl   (revision 1217)
 > +++ www/cdfiles2/xsl/cd.xsl   (working copy)
 > @@ -437,9 +437,9 @@
 >
 >
 > -<xsl:template name="test-file-exists" xmlns:file="java.io.File">
 > +<xsl:template name="test-file-exists">
 >     <xsl:param name="filename" select="'x'"/>
 > -<xsl:value-of select="file:exists(file:new(string($filename)))"/>
 > +<xsl:value-of select="unparsed-text-available($filename)"/>
 >   </xsl:template>

Note that in 
http://svn.openmath.org/OpenMath/OpenMath2++/xsl/cd2html-util.xsl (which 
is an experimental version for "the version after OpenMath 2") I 
recently made a similar change, but using document() instead of 
unparsed-text-available().  I don't recall the exact reason, but somehow 
unparsed-text-available() didn't work for me.  (Does it work for you? 
Then I should give it another try.)  I'm not sure about the performance, 
but in terms of functionality document() is OK here, as we are checking 
for the existence of *.ocd files, i.e. XML.

Ch eers,

Christoph

-- 
Christoph Lange, Coordinator CASE Research Center
http://www.jacobs-university.de/case/, http://kwarc.info/clange

Mathematical Wiki workshop at ITP 2011, August 27, Nijmegen, Netherlands
Submission deadline May 30, http://www.cs.ru.nl/mwitp/

Jacobs University Bremen gGmbH, Campus Ring 1, 28759 Bremen, Germany
Commercial registry: Amtsgericht Bremen, HRB 18117
CEO: Prof. Dr. Joachim Treusch
Chair Board of Governors: Prof. Dr. Karin Lochte


More information about the Om mailing list