All, We've just upgraded a development server from 6.0-2 to 6.0-3 and found that our existing working code broke in a couple of places. In both cases, the underlying issue seems to be that 6.0-3 is less forgiving about finding in-scope modules and definitions than it was. Here's what we ran into (in both cases, code started out within an older version of App Builder):
1. XDMP-MODNOTFOUND error resulting from a relative path; code stored in a modules database (problem not seen in filesystem code) Original code was like: <xdmp:import-module href="ourstuff.xqy" namespace="ourURI"/> where "ourstuff.xqy" was in the same modules directory location as the calling module. We had to rewrite as an absolute URI: <xdmp:import-module href="/custom/ourstuff.xqy" namespace="ourURI"/> (this one puzzles us, though, because the relative path ought to work, cf. http://docs.marklogic.com/guide/app-dev/import_modules#id_29407) 2. XDMP-UNDFUN (undefined function) resulting from inability of xdmp:function() to find the referenced function, when called from a variable. Boiled down, here was the situation, inside App Builder modules standard.xqy and config.xqy. In standard.xqy: module namespace asc = "http://marklogic.com/appservices/component"; import module namespace config="http://marklogic.com/appservices/config" at "/lib/config.xqy"; . . . declare function asc:css() as node()* { ... definition of function ... }; [later] xdmp:apply($config:css) (: using variable defined in config.xay :) In config.xqy: [no import of standard.xqy] declare variable $css := xdmp:function( fn:QName( "http://marklogic.com/appservices/component", "css")); The previous version of MarkLogic permitted this to work even though asc:css() was not in scope in config.xqy, presumably because it is in scope where called in standard. xqy. 6.0-3 is not that forgiving. The fix in this case is to import standard.xqy into config.xqy (alternatively, the module location could be added as the second argument to xdmp:function). David -- David Sewell, Editorial and Technical Manager ROTUNDA, The University of Virginia Press PO Box 400314, Charlottesville, VA 22904-4314 USA Email: [email protected] Tel: +1 434 924 9973 Web: http://rotunda.upress.virginia.edu/ _______________________________________________ General mailing list [email protected] http://developer.marklogic.com/mailman/listinfo/general
