[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Returning node-set from javascript-extension

Subject: Returning node-set from javascript-extension
From: Christof Schreuer <schreuer.christof@xxxxxxxxxxxxxxxx>
Date: Wed, 19 Jan 2005 16:05:16 +0100
javascript extension
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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.