Posts tagged "loadxml"

Acrobat/Reader 7: using loadXML() to load data can result in an Acrobat crash

Issue

 If you are using loadXML() to load data into a PDF, where the XML contains attributes like “nill=true”, then you may experience an application crash in Acrobat/Reader 7.

For example, if you use Javascript code in your form similar to:

------Form.page1.Button1::click - (JavaScript, client) -----------
try {
    xfa.record.FORM.loadXML(xfa.resolveNode("FORM.page1.txtXMLData").rawValue, true, true);
    xfa.form.remerge();
} catch(err) {
    xfa.host.messageBox("Exception:" + err.name + " - " + err.message);
}

where textXMLData contains the following data:

<?xml version="1.0" encoding="UTF-8"?>
<FORM xmlns="http://www.company.com/testNil" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
 <CaseManagement>
 <CaseInitiationDate xsi:nil="true" />
 ...
 </CaseManagement>
</FORM>

Reason

 This is a bug in Acrobat/Reader 7.

Solution

 This bug has been fixed in Acrobat/Reader 8.

There is also a simple workaround to this problem:

On the form itself, ensure that the  “attributes” data loading option is set to ignore as follows:

<config>  <present>  <common>  <data>  <attributes>ignore</attributes>  </data> ... 

__________________________________________

reference: (1-16996911/1266068)

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 0.0/10 (0 votes cast)