[Xsltforms-support] User defined function not working in xf:bind
Brought to you by:
alain-couthures
From: Matthew G. <mj...@ca...> - 2012-12-31 01:07:22
|
Hi, I have a binding which makes use of the xpath-functions ends-with function: <xforms:bind nodeset="instance('record')/Name/@Sex" relevant="not(ends-with(instance('record')/Name/@Id, '.0'))"/> However, this does not appear to be supported in XSLTForms so I have attempted to define a local function to do this: <script> XPathCoreFunctions["http://www.w3.org/2005/xpath-functions ends-with"]= new XPathFunction( false, XPathFunction.DEFAULT_NONE, false, function(x) { return this.indexOf(x, this.length - x.length) !== -1; } ); </script> However, when I try and use this, I get XSLTForms Exception -------------------------- Error initializing : Function http://www.w3.org/2005/xpath-functions ends-with() not found Uncaught ReferenceError: XPathCoreFunctions is not defined (anonymous function) I am using r559 build and Chrome. I've tried using a dummy namespace or local namespace for the function but to no avail. Cheers, Matthew Graham |