These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Import-export data from-to an XML file cleaning old fields

sgf.nuccio
Registered: Sep 14 2010
Posts: 3
Answered

Hi.
I've done a PDF form with LiveCycle Design to acquire data.

The form save output data in to an XML file (xfa.host.exportData("",0);), and acquire data from saved XML ($host.importData("")), to modify contents before to save it again.

From the original PDF form I've done many new releases: created new fields, deleted old fields, moved fields to other level in to the form structure.

Now, when I load data from an old XML file (saved with previous releases), my form is correctly populated, and I can modify data, but when I save data in a new XML files, in his structure I find again old data in old fields that I've deleted from the form.

More, fields moved to another level (for an example, a field located in a named module, converted to global), is modified but saved in older position, under old module and not in the root.

How can it be? And, more important, how can I correct this problem?

S.G.F. - Florence (Italy)

Bamboolian
Registered: Jul 27 2010
Posts: 48
Hi,

Since the XML data imported from file is kept under "xfa.data." in XML schema tree structure as in the files, it would export in the same way.
PDF forms would not automatically change and convert the tree structure into new definition.
Generally in LCD, when incoming XML structure and form defined XML structure is different, convertion is done using XSLT, but this is only in cases when you always expect this kind of conversions.

For your case it seems that it is only one time solution, and in that case you will probablly need to map old and new schema and convert the structure before you import XML to your new form.

sgf.nuccio
Registered: Sep 14 2010
Posts: 3
Tank you Bamboolian.
I will try to do so.

S.G.F. - Florence (Italy)

Amyda
Registered: Jan 29 2011
Posts: 1
I recommand you one kind of the third party add-in, Spire.DataExport. It can meet your requirement exactly. And it published the free version.
You can download the free one from http://www.e-iceblue.com/Download/download-dataexport-for-net-now.php