How can I export to an XML file when I'm already importing data from a different one? When I set the Binding to Normal, it says it may produce undesirable results, which it does. It doesn't save the XML data that I entered into the form.
Views
Replies
Total Likes
Hi, Have a look at this blog
http://blogs.adobe.com/formfeed/2009/11/working_with_multiple_datasets.html. Basically your export button will have swap datasets
so the xml you want is picked up.
Good luck.
Bruce
Views
Replies
Total Likes
Very insightful. But it's my understanding, that you just merge the data or append the data. What I need to do is use one as an input file and one as an output file. Independent of each other.
Views
Replies
Total Likes
Hi,
When it comes to XML data connection it can be very frustrating in Designer. I have experienced the same. There are few points which might help you.
If you set the binding as normal then it will show an error in the Designer as you have a default data binding and upon submitting those values would not be exported.
If you set the data binding pointing to the node/attribute which you want then it would export all those XML contents that you are embedding in the form instead of field values which are field in the form.
Primarily you have only two options here.
1. Use a sample XML data or XML schema to embed then transform the output XML using XSLT. But you need to have depth understanding of XSLT and the transformation. data mapping etc.
2. You need to get rid of those data binding , embed the XML and read the XML by scripting.
This is not so easy as it seems. Good Luck.
Thanks.
Bibhu.
Views
Replies
Total Likes
Hi,
Here is a sample code that might help you.
var CustomerInformationIndex = this.boundItem(xfa.event.change);
xfa.resolveNode("dataroot.P1.Cust_Number").rawValue = xfa.event.change;
var CustomerNumber = xfa.event.change;
Cust_Name.rawValue = $record.CustomerInformation.CustomerName.value;
var list = xfa.resolveNodes('$record.CustomerInformation.[At(Lower(CustomerID),Lower("'+xfa.event. newText+'")) > 0]');
for (var i = 0; i < list.length; i++)
{
var CustomerInformation= list.item(i);
Cust_Name.rawValue = (CustomerInformation.CustomerName.value);
}
Here the root node is CustomerInformation. Basing upon the node I am updating basing the CustomerName. Here a list is used to show and contain the information.
Thanks.
Bibhu.
Views
Replies
Total Likes
What about using xfa.host.importData("XMLFilename");? I heard this might work, but when I run it, the data from the XML file doesn't get displayed. Do I need to assign the data to a predefined variable?
Views
Replies
Total Likes
You cannot automate the importing of an xml file (unless you certify and that has its own set of issues) ....you can bring up the dialog and allow the user to choose a file but you cannot programmatically open it for them (against the security model). So the command woudl be xfa.host.importData("", false). The false parameter tells the dialog that you only want xml extensions otherwise you will get xdp extensions instead.
Paul
Views
Replies
Total Likes
But once they've chosen the file, how do you deal with the information on the file? Would it be something like this:
XML File****
Javascript ****
xfa.host.importData("", false)
this.rawValue = xfa.datasets.data.topmostform.CCUInfo.Name.value;
Views
Replies
Total Likes
Firstly I messed up the command ...it is xfa.host.importData(). I gave you syntax for the export by mistake.
When you import a data file it will load the data file into the data dom for you. If your bindings are setup correctly then the data will be placed into your fields without you having to add script.
Paul
Views
Replies
Total Likes