Hi there,

Im new to ECMA script and Im having a problem that I could not find a
solution yet. Im trying to create an array from a string and Im
getting the following error.

DirXML Log Event -------------------
Driver: \IDV-DEV\vale\services\IDM\Vale_IDV_DR_SET\VALENET AD
Data Sync
Channel: Subscriber
Object: \IDV-DEV\vale\People\Contractors\gcg3563
Status: Error
Message: Code(-9131) Error in
vnd.nds.stream://IDV/novell/servicos/DRV_SET/TEST_DRIVER/Subscriber/sub-ctp-ReplaceCharacters#XmlData:263
: Error evaluating XPATH expression 'token-xpath("es:replaceCharacters(
$VarNewPwd,$VarNumberCharacters)")' :
com.novell.xml.xpath.XPathEvaluationException: TypeError:
com.novell.soa.script.mozilla.javascript.NativeArr ay@37ad2ce5 is not a
function.
(vnd.nds.stream://IDV/novell/servicos/DRV_SET/Library/Replace+Characters#DirXML-Data#28).

The ECMA script is shown below. I got the import commands from
NOVLLIBAJC-JS ECMA script because I could not find which package or Java
class to import. But it looks like I still dont have the one that has
the Array function defined. Can anyone help me to either indentify the
problem in the code or tell me which package to import? Thanks.

Gustavo

/**
* Routine to replace charactes in a string
* @author Gustavo
*/

importPackage(java.io);
importPackage(Packages.org.w3c.dom);
importClass(Packages.com.novell.xml.util.Base64Cod ec);
importClass(Packages.com.novell.nds.dirxml.driver. XmlDocument);
importClass(Packages.com.novell.xml.dom.DOMWriter) ;
importClass(java.util.GregorianCalendar);
importClass(java.text.DateFormat);
importClass(java.text.SimpleDateFormat);
importClass(java.lang.System);
importClass(java.lang.Integer);


function replaceCharacters(inputString,sizeString)
{
var VarChar;
var outputString = "";
var splitString = new Array();
var wholeString = String(inputString);
splitString = wholeString.split('');

for (var i = 0; i < sizeString; i++)
{
VarChar = splitString(i);
if ( VarChar == "A")
{
outputString = outputString + "a";
}
else
{
}
}
return outputString;
}


--
gabaurre
------------------------------------------------------------------------
gabaurre's Profile: https://forums.netiq.com/member.php?userid=751
View this thread: https://forums.netiq.com/showthread.php?t=46511