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

RE: Calling a java function and returning a NodeList

Subject: RE: Calling a java function and returning a NodeList
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Sat, 21 Sep 2002 12:20:11 +0100
java function return
> Can i return a Nodelist or a Node from a Java function to a 
> XSL. I want to return the Node or Nodelist using JAXP and not 
> go with any 
> specific XML Parser. I learnt that saxon needs NodeList built 
> using its own 
> parser. Is there any way around?. I want my java code and xsl 
> fully compiant 
> with JAXP and Trax API.

The most portable way of doing this is to use the document() function
with a URI of your own invention, along with a URIResolver that returns
the result in the form of a DOMSource, SAXSource, or StreamSource
object.

This is a bit tricky, though, if your function has complex parameters.
In this case you are stuck with using extension functions, and each XSLT
processor has its own rules for what arguments and return values it
accepts. Many XSLT processors will only accept DOM nodes that were
created by the same product, e.g. if you use the Oracle XSLT processor
you have to use the Oracle DOM implementation. Recent release of Saxon
allow an extension function to return a DOMSource, which can wrap any
DOM - but it's expensive.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx 


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


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.