- From: Vladimir Rodimyuk <VladimirR@ukrinvent.com>
- Date: Fri, 14 Sep 2007 14:30:29 +0300
- To: axdmoraes <alexmoraes@gmail.com>, "www-xsl-fo@w3.org" <www-xsl-fo@w3.org>
- Message-ID: <C50378BB9C267D4796753862ED9AE1A346BFE5F954@UI-OPTERON.ukrinvent.com>
Hi Alexandre, Well, mea culpa, I posted a link to recipe for Saxon 8 processor which is not used by XEP. The XEP formatter is using Saxon 6.5. Anyway the posted link is a successor of the thread that does contain a solution for your problem. See here: http://www.biglist.com/lists/xsl-list/archives/200006/msg01332.html Here is a snippet ready to use. <xsl:template name="file.check" xmlns:file="java.io.File" > <xsl:param name="filename" /> <xsl:choose> <xsl:when test="function-available('file:new')"> <xsl:variable name="fileobj" select="file:new($filename)" /> <xsl:choose> <xsl:when test="not(file:exists($fileobj))"> <xsl:value-of select="true()"/> <xsl:message> <xsl:text>File name='</xsl:text> <xsl:value-of select="$filename" /> <xsl:text>' exists.</xsl:text> </xsl:message> </xsl:when> <xsl:otherwise> <xsl:value-of select="false()"/> <xsl:message> <xsl:text>File name='</xsl:text> <xsl:value-of select="$filename" /> <xsl:text>' does not exist.</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:when> <xsl:otherwise> <xsl:message> <xsl:text>WARNING : unable to call function 'file:new'</xsl:text> </xsl:message> </xsl:otherwise> </xsl:choose> </xsl:template> See attached stylesheet for example how to use it. Respectfully, Volodymyr Rodymyuk > -----Original Message----- > From: www-xsl-fo-request@w3.org [mailto:www-xsl-fo-request@w3.org] On > Behalf Of axdmoraes > Sent: Thursday, September 13, 2007 3:57 PM > To: www-xsl-fo@w3.org > Subject: Re: external-graphic > Iīm using xep 4.10.. > Alexandre > Tony Graham-3 wrote: > >> I tryed this: > >> > >> <xsl:variable name="absoluteURI" select="resolve-uri(@src, > >> base-uri(.))" as="xs:anyURI"/> > >> But it didnīt work. > > resolve-uri() is an XPath 2.0 function, and it appears that you are > > using an XSLT 1.0 processor since it doesn't recognise the "as" > > attribute. > > > > To use Michael Kay's example in his XSL-List post, you would need a > > Java-based XSLT 2.0 processor (such as Michael Kay's 'Saxon'). > > > > Tony Graham.
Attachments
- text/xml attachment: test_file.xsl
Received on Friday, 14 September 2007 11:36:12 UTC