[Xsltforms-support] Rev 628 error using .getInstanceDocument()
Brought to you by:
alain-couthures
|
From: Mark S. <m_s...@ma...> - 2016-01-11 11:58:32
|
Hi, I have just moved to rev 628 and some script that had been working fine now returns the error: ReferenceError: Can't find variable: XsltForms_context I am assuming that it is related to the use of .getInstanceDocument() in the code. Is my code out-of-date in some way? Best wishes Mark Here is a test form that gives me the error: <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet href="../xsltforms/xsltforms.xsl" type="text/xsl"?> <?xsltforms-options debug="yes"?> <?css-conversion no?> <html xmlns = "http://www.w3.org/1999/xhtml" xmlns:xf = "http://www.w3.org/2002/xforms" xmlns:ev = "http://www.w3.org/2001/xml-events" > <head> <title> Test </title> <script type = "text/javascript" > <![CDATA[ function getXML() { var modelElem = document.getElementById("theModel"); xmlDoc = modelElem.getInstanceDocument("content"); } ]]> </script> <xf:model id = "theModel" > <xf:instance id = "content" > <doc> Hello </doc> </xf:instance> <xf:action ev:event = "xforms-ready" > <xf:load resource = "javascript:getXML()" /> </xf:action> </xf:model> </head> <body> <p><xf:output ref = "instance('content')" /></p> </body> </html> |