xsl-list
[Top] [All Lists]

Returning node-set from javascript-extension

2005-01-19 08:05:16
Hi,
i've got problems with returning a node-set from a javascript extension
to a XSLT-Template.

This is done like in the following example:

1) First I call an an js-extension function to store an selected
dom-tree. The function addDocument stores the given object in a global
variable.

<xsl:copy-of select="jsxep:addDocument(.)"/>

2) Later in the Template I want use the information stored in the global
js-variable. This is done with another js-extension function.

<xsl:variable name="test">
  <xsl:value-of select="jsxep:getDocument()"/>
</xsl:variable>

If I generate some output with <xsl:value-of select="$test"/>
everything seems to be fine. The text-contents of the stored variable
can be generated.
If I try to access a node of $test with following statement:
<xsl:value-of select="$test/@id"/> an xalan error message appears, even
if the id-Attribute is set.

Error-Message:
javax.xml.transform.TransformerException: java.lang.ClassCastException:
org.apache.xpath.objects.XString......

It seems that the js-variable is converted to another object....

Thanks Christof



--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>