David Leangen wrote:

Hi!

I'm trying to convert a result tree fragment to a nodeset in Cocoon 2.1.3,
but with no success. Just to make sure that I didn't mess anything up with
my Cocoon configuration, I even tried a fresh build, but I get the same
problem.

The closest thing I found to help me solve my problem was the thread:

http://marc.theaimsgroup.com/?l=xml-cocoon-users&m=100517834709158&w=2

Specifically:

 I assume that you are using Xalan when using Cocoon. Then you
 can use the extension-function nodeset():
 http://xml.apache.org/xalan-j/extensionslib.html#nodeset.
 Other processors like MSXML or Saxon have similar functions.

Joerg


I have tried this approach:


<xsl:stylesheet version="1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform";
xmlns:xalan= "http://xml.apache.org/xalan";
exclude-result-prefixes="xalan"



<xsl:template name="tokenize"> <xsl:param name="string" select="''" /> <xsl:param name="delimiters" select="' &#x9;&#xA;'" />


<xsl:variable name="result"> <tokens> <xsl:call-template name="_tokenize"> <xsl:with-param name="string" select="$string"/> <xsl:with-param name="delimiters" select="$delimiters"/> </xsl:call-template> </tokens> </xsl:variable>

<xsl:value-of select="xalan:nodeset($result)"/>

</xsl:template>

...

</xsl:stylesheet>


But get this error:


org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
java.lang.RuntimeException: Can not convert #RTREEFRAG to a NodeList!

I have also tried this:

<xsl:stylesheet version="1.0"
xmlns:xsl = "http://www.w3.org/1999/XSL/Transform";
xmlns:nodeset="org.apache.xalan.xslt.extensions.Nodeset"
exclude-result-prefixes="nodeset"



<xsl:template name="tokenize"> <xsl:param name="string" select="''" /> <xsl:param name="delimiters" select="' &#x9;&#xA;'" />


<xsl:variable name="result"> <tokens> <xsl:call-template name="_tokenize"> <xsl:with-param name="string" select="$string"/> <xsl:with-param name="delimiters" select="$delimiters"/> </xsl:call-template> </tokens> </xsl:variable>

<xsl:value-of select="nodeset:nodeset($result)"/>

</xsl:template>

...

</xsl:stylesheet>

But get this error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
java.lang.RuntimeException: java.lang.NoSuchMethodException: For extension
function, could not find method
org.apache.xml.dtm.ref.DTMNodeIterator.nodeset([ExpressionContext,] ).


Any ideas?



this is no Cocoon specific problem but the way how XSLT works.
See http://www.biglist.com/lists/xsl-list/archives/200101/msg01379.html and http://xml.apache.org/xalan-j/extensionslib.html#nodeset


--
Reinhard


--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to