xsl-list
[Top] [All Lists]

RE: XSLT Extension Functions

2002-09-12 15:54:13
Why not use the xalan:evaluate() extension function instead?

Michael Kay
Software AG
home: Michael(_dot_)H(_dot_)Kay(_at_)ntlworld(_dot_)com
work: Michael(_dot_)Kay(_at_)softwareag(_dot_)com 

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Hushagen, Michael E.
Sent: 12 September 2002 19:22
To: 'XSL-List(_at_)lists(_dot_)mulberrytech(_dot_)com'
Subject: [xsl] XSLT Extension Functions


Hi all!
I recently entered the wonderful world of XSLT Extensions.  
I'm converting an XSL stylesheet from a Microsoft environment 
to a Java environment.  The stylesheet has several extension 
functions defined such as this:

 <msxsl:script language="JScript" implements-prefix="local"><![CDATA[
                function selectNodes(contextNodeList,path)
                {
                  return contextNodeList.item(0).selectNodes(path);
      }
 ]]></msxsl:script>

As you can see, it's using Jscript and is called during the 
transformation process using MSXML.

I converted the functions to Java methods such as this:

public NodeList selectNodes(NodeList contextNodeList,String path) {   
return XPathAPI.selectNodeList(contextNodeList.item(0), path); }

This Java function is called during the transformation 
process using Xalan. These functions are called from inside 
the XSL stylesheet like this: <xsl:variable name="vRoot" 
select="/"/> <xsl:value-of 
select="local:selectNodes($vRoot,'Xpath expression goes here')"/>


My problem is this:
The node list that is passed into these functions seem to be 
of different types depending on what transformer/function 
type is used.  The nodelist that is passed into my Java 
function is a DTMNodeList which is a Xalan class.  The 
nodelist that is passed into the Microsoft Jscript function 
is a different, generic node list. This difference in types 
is causing problems.  Does anybody know anything about 
this??? Any help would be greatly appreciated.

Thanks!
 -Mike H.


__________________________________________________________________
This information is intended only for the use of the 
addressee(s) and may contain privileged, confidential or 
proprietary information.  If you are not the intended 
recipient, or the employee or agent responsible for 
delivering the message to the intended recipient, you are 
hereby notified that any dissemination, distribution, 
displaying, copying, or use of this information is strictly 
prohibited.  If you have received this communication in 
error, please notify us immediately at 
Administrator(_at_)fedins(_dot_)com or by telephone at (800) 533-0472, 
and return the information to the sender with all copies 
deleted and destroyed.  Thank you.


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



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



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