This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
RE: XSLT Extension Functions
- From: "Michael Kay" <michael dot h dot kay at ntlworld dot com>
- To: <xsl-list at lists dot mulberrytech dot com>
- Date: Thu, 12 Sep 2002 23:54:13 +0100
- Subject: RE: [xsl] XSLT Extension Functions
- Reply-to: xsl-list at lists dot mulberrytech dot com
Why not use the xalan:evaluate() extension function instead?
Michael Kay
Software AG
home: Michael.H.Kay@ntlworld.com
work: Michael.Kay@softwareag.com
> -----Original Message-----
> From: owner-xsl-list@lists.mulberrytech.com
> [mailto:owner-xsl-list@lists.mulberrytech.com] On Behalf Of
> Hushagen, Michael E.
> Sent: 12 September 2002 19:22
> To: 'XSL-List@lists.mulberrytech.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@fedins.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