Hi Neil,

I believe there was an incompatibility with mljam that has since been fixed.  
In 4.1, there were a lot of regex fixes, and the old mljam code would throw 
this exception (\ is an invalid regexp).  The latest version of mljam fixed 
this and the function now looks like this:

http://xqzone.marklogic.com/svn/mljam/trunk/client/jam.xqy

define function jam:_escape-string(
  $s as xs:string
) as xs:string
{
  (: These replaces funny because arg2 is a regexp and arg3 is a literal :)
  let $s := replace($s, '\\', '\\\\') (: \ replaced with \\ :)
  let $s := replace($s, '"', '\\"')  (: " replaced with \" :)
  let $s := replace($s, '
', '\\n')
  return $s
}

So my guess is that your client needs to update his mljam to the latest and 
then it will work.

-Danny


From: [email protected] 
[mailto:[email protected]] On Behalf Of Neil Bradley
Sent: Thursday, January 21, 2010 1:35 PM
To: 'General Mark Logic Developer Discussion'
Subject: [MarkLogic Dev General] Problem with ML 4.1-4 and MLJAM

Hi,

I am using 4.1-1 and do not have a problem. My client is using 4.1-4 and gets 
the following error, which I have pinpointed to the MLJAM function here (the 
second replace):

define function jam:_escape-string(
  $s as xs:string
) as xs:string
{
  (: These replaces funny because arg2 is a regexp and arg3 is a literal :)
  let $s := replace($s, '\\', '\\') (: \ replaced with \\ :)
  let $s := replace($s, '"', '\"')  (: " replaced with \" :)
  let $s := replace($s, '
', '\n')
  return $s
}

Has the interpretation of the fn:replace() function changed in the latest 
version? How to I overcome this problem and get MLJAM working again?

XDMP-BADREP: (err:FORX0004) 
fn:replace("data/internationalSwapsAndDerivativesAssociation/masterAgreement...",
 """, "\"") -- Invalid replacement string: \"
in /jam.xqy, on line 634,

Thanks.

Neil.


_______________________________________________
General mailing list
[email protected]
http://xqzone.com/mailman/listinfo/general

Reply via email to