I'm back again with more ECMA questions. I'm attempting to convert the
demo from TUT369 to use a loopback driver, so that I can take action (i.e.
modify) against the results returned from the LDAP search (because the
query token is not as robust as an LDAP query).

The problem I'm currently encountering is that I cannot call the ECMA
function (located in a library) from within a stylesheet. I have the ECMA
object associated with the driver successfully - a policy in the same
driver is able to call the function. When I try to call the function from
within XSLT, however, I get the following error in the trace:

[6/13/2007 09:05:09.50] Drvrs : Business Rules Checker ST:
DirXML Log Event -------------------
Driver: DEV-01servicesDriver SetBusiness Rules Checker
Channel: Subscriber
Status: Error
Message: Code(-9061) Error processing XSLT policy:
vnd.nds.stream://DEV-01/services/Driver+Set/Business+Rules+Checker/Subscriber/XSLT+Catch+Trigger#XmlData
(22): <xsl:for-each>: expression evaluation error: function
'es:ldapSearch' not found



The stylesheet that's generating this error follows. I would appreciate
any guidance you can provide.

Which brings up the question of how does everyone (Father) learn about
this stuff? Most of the documentation I've been able to find is pretty
weak and the few documented examples I've found are too simplistic to be
of much help.



<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet exclude-result-prefixes="query cmd dncv" version="1.0"
xmlns:cmd="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsCommandProcessor"
xmlns:dncv="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.DNConverter"
xmlns:es="http://www.novell.com/nxsl/ecmascript"
xmlns:query="http://www.novell.com/nxsl/java/com.novell.nds.dirxml.driver.XdsQueryProcessor"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<!-- parameters passed in from the DirXML engine -->
<xslaram name="srcQueryProcessor" />
<xslaram name="destQueryProcessor" />
<xslaram name="srcCommandProcessor" />
<xslaram name="destCommandProcessor" />
<xslaram name="dnConverter" />
<xslaram name="fromNds" />
<!-- identity transformation template -->
<!-- in the absence of any other templates this will cause -->
<!-- the stylesheet to copy the input through unchanged to the output -->
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="@*|node()" />
</xsl:copy>
</xsl:template>
<!-- add your custom templates here -->
<xsl:template match="trigger[@source='Way to Disable Trigger']">
<xsl:variable name="driver-pwd">
<xsl:value-of
select="query:getNamedPassword($destQueryProcessor ,
'businessrulesdriver')" />
</xsl:variable>
<xsl:for-each
select="es:ldapSearch('localhost', 636,
'cn=businessrulesdriver,o=services',$driver-pwd, 'ou=people,dc=xxx',
'sub', '(uid=*)', 'cn,uid')">
<xsl:value-of select="." />
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>