I've written the below function in order to "Title Case" names that
comes from an HR system, but also to look out for special words which
must only be set to lower case.


function nameCapitalise(name)
var splitName = new Array();
splitName = name.split(' ');
name = '';

var exceptions = new Array("van","der","du","de");

for (count = 0; count < splitName.length; count++)
exceptionFlag = 0;
splitName[count] = splitName[count].toLowerCase();

for (ecount = 0; ecount < exceptions.length; ecount++)
if (splitName[count] == exceptions[ecount])
exceptionFlag = 1;

if (exceptionFlag == 0)
splitName[count] = splitName[count].substr(0,1).toUpperCase() +
name = name + splitName[count] + " ";
name = name.substr(0,name.length - 1);
return name;


In a browser it works perfectly.

I've implemented it into a driver set library, linked it to a driver
and used it in a policy which does the following action:




When evaluating the result of the function, however, the following
error shows in the trace.


Message: Code(-9131) Error in
: Error evaluating XPATH expression 'token-xpath("es:n
ameCapitalise($current-value)")' :
com.novell.xml.xpath.XPathEvaluationException: TypeError: split is not a


As far as I can tell from the 'ECMASCRIPT spec'
the 'split' function is part of the base spec for version 3 and for the
draft of version 4.

Am I doing something else wrong here?

preycor's Profile: http://forums.novell.com/member.php?userid=7822
View this thread: http://forums.novell.com/showthread.php?t=389071