Expand my Community achievements bar.

generate an xml file

Avatar

Former Community Member
Hi,



i am working on a form (Designer eng 7.1 --> xfa v. 2.4), where a part of the xml data have to be loaded in an external file (*.xml) and then attached to a mail to be sent back.



Cause i did not find a way to extract just a part of my data by using the export function or, that would be even better, the send mail function with xml export, i use xpath to get the informations and generate an xml-variable with javascript. Now i have the content of my xml file and tryed to save it by doing:



saveFile = app.trustedFunction(

function (strContainer) {

app.beginPriv();

try{

var myDoc = event.target;

myDoc.createDataObject({ cName: "myExport.xml", cValue: strContainer, cMIMEType: "text/xml"});

myDoc.exportDataObject({ cName: "myExport.xml", cDIPath:this , bAllowAuth: false, nLaunch: 1 });

return 0;

}



catch(err){

console.println("Error: " + err);

return 1;

}



app.endPriv();

}

);



I saved this script in a *.js file and putted this in the Acrobat/JavaScript folder to get privileged rights. This still doesn't work and i get the exception: Security Settings prevent the use of this function or method.



Anyone a clue? thx a lot,



Valerio
0 Replies