You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xalan.apache.org by Marion Freese <ma...@IMS.Uni-Stuttgart.DE> on 2002/08/08 12:19:07 UTC

evaluate extension function does NOT WORK (sent wrong error message)

Hi again,

sorry, but I sent the wrong error message. The exact one with the posted
files is
(i) using xalan-j_2_4_D1, jdk1.3.0_03 and Linux:

(Location of error unknown)XSLT Error (javax.xml.transform.TransformerException):
java.lang.NoSuchMethodException: For extension function, could not find method org.apache.xml.utils.NodeVector.evaluate([ExpressionContext,] ).

(ii)using  xalan-j 2.0.1, java 1.1.6 and Unix (xalan-j_2_4_D1 does not
work here):
XSLT Error (javax.xml.transform.TransformerException): For extension function, could not find method
org.apache.xpath.axes.AttributeIterator.evaluate([ExpressionContext,] ).


The even stranger error I posted before comes from using
<s id="s1" xlink:href="xpointer(substring(//div[1]/p[1]/text(),1,64))"/>
in the xml file and
<xsl:variable name="link" select="substring-after(@xlink:href, 'xpointer')"/>
	<xsl:for-each select="document('foo.xml')">
		<xsl:value-of select="xalan:evaluate($link)"/>
in the stylesheet.

I'm puzzled because of this one, too %-\


Marion


---------- Previous message ----------
Date: Wed, 7 Aug 2002 20:05:36 +0200 (MEST)
From: Marion Freese <ma...@ims.uni-stuttgart.de>
To: xalan-j-users@xml.apache.org
Subject: evaluate extension function does NOT WORK

Hi there,

I'm trying to use the evaluate extension function, but it
does not work:

XSLT Error (javax.xml.transform.TransformerException): For extension
function, could not find method java.lang.String.evaluate([ExpressionContext,] ).

I've tried it with Xalan2.0.1,and Xalan 2.4.D1 and different Java
versions.

My stylesheet:

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:fo="http://www.w3.org/1999/XSL/Format"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xalan="http://www.apache.org/xalan" exclude-result-prefixes="xalan">
<xsl:output method="text" version="1.0" encoding="ISO-8859-1"/>

<xsl:template match="level">
	<xsl:apply-templates/>
</xsl:template>

<xsl:template match="s">
	<xsl:variable name="link" select="@xlink:href"/>
	<xsl:for-each select="document('foo.xml')">
		<xsl:value-of select="xalan:evaluate($link)"/>
		<xsl:text>
</xsl:text>
	</xsl:for-each>
</xsl:template>

</xsl:stylesheet>

I also tried to put the evaluate in the variable select - does not work...


The XML file I applied it to:

<level type="sentence" xmlns:xlink="http://www.w3.org/1999/xlink"
xlink:type="simple" xml:base="foo.xml#xpointer">
	<s id="s1" xlink:href="(substring(//div[1]/p[1]/text(),1,64))"/>
	<s id="s2" xlink:href="(substring(//div[1]/p[1]/text(),66,94))"/>
	<s id="s8"
xlink:href="(substring(//div[1]/p[1]/text(),1134,253))"/>
	<s id="s9" xlink:href="(substring(//div[1]/p[2]/text(),1,189))"/>
</level>



Thanks for any hint!

Marion



Check only if the xpath statement gets some data

Posted by tom john <cy...@yahoo.com>.
hi,
i just need to check if the given xpath statement gets
points to some data in the given xml document. only
'true' or 'false' (contains required data or not) is
enough. how to do it using XPathAPI?
regards 

__________________________________________________
Do You Yahoo!?
HotJobs - Search Thousands of New Jobs
http://www.hotjobs.com