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

addInstance and XML Node output

stonesrock
Registered: Feb 27 2007
Posts: 54
Answered

Found something weird and not sure if I'm missing something in form setup or what. Here is the scenario:

I'm building a dynamic form. After creating XML data file from Access database, I then started building new form with this XML dataset. This is a process I've done in the past, with functionality built in to addInstances. When I do these instance adds, it is for adding multiple entries to one field, which should write the XML in multiple nodes like this:

-
12345678

-
22222222

-
33333333

What I've found is that this node will only write out like this if I remove the Data Connection after I've built the form??? The subform for this node example has to have Binding like this: $record.ExampleMapping[*]

Now, for the fields without addInstance, the Binding has to be like this: $record.GeneralInformation.CustomerZip

Am I doing something wrong in my design to have to basically add a Data Connection, build my form, then remove Data Connection and make sure everything ties (so will map to database design). I don't have the capability to link to database, so I'm basically using the Email XML to have sent to analyst, who drops XML file into folder and this loads into database.

I know a bit lengthy, but I'm hoping someone can make sense out of this.
Thanks in advance...

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
You should not have to remove the Data connection for repeated subform data to be written out. It seems you're doing it the right way. When you export data from the form, that data should follow the pattern of the bound data on the form. I do this all the time using LC and Acrobat 8.

Have you tried testing the form you built in LC 8.2 in Acrobat 8? You could be seeing a bug in Acrobat 9.

Did you check the "ConnectionSet" and "DataSets" nodes in the XFA XML? The connectionset should be a simple reference to the original XML file, nothing else since it's not a real data connection. It's just there to give the data a format. The DataSets should be an XML structure that paralells the structure of the original XML file. Repeated nodes in the original XML should be marked as multiple instance nodes in the Datasets.

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

stonesrock
Registered: Feb 27 2007
Posts: 54
thomp,

Thanks for the reply. I appreciate you answering, you have given great advice in other postings throughout the board, so I'm glad you answered!!!

Using LS 8.0. Did test on Acrobat 8, haven't upgraded to 9 reader yet. A

Okay, followed your advice, just stuck on where you stated:
"The DataSets should be an XML structure that paralells the structure of the original XML file. Repeated nodes in the original XML should be marked as multiple instance nodes in the Datasets."

Could you please give me a bit more direction on this, not sure where to look. Looked through help and not sure where I'm missing this.

Thanks again!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
To display the underlying XML for the form, select the "View > XML Source" menu item. Scroll down towards the bottom, this is where you'll find the DataSets and ConectionSet nodes. To do a text search on the XML press Ctrl-f.Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

stonesrock
Registered: Feb 27 2007
Posts: 54
Thanks for quick reply thomp!

A bunch of "garbage" code after reference to image on my "design" master. Looks like this and after a ton of lines of "garbage, the code is all blue. I just tried a new form with connection to same XML form, all the code and tags are "color coded" correctly. Here is what occurs with "garbage"

<?xml version="1.0" encoding="UTF-8"?>
<?xfa generator="AdobeLiveCycleDesigner_V8.0" APIVersion="2.5.6290.0"?><?formServer allowRenderCaching 0?>
<?formServer formModel both?>SUkqAOLWEwD/////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////+/v7+////////+//////+//r//f7/////
//v//v/+///+//////3///3///3+//3///////////////3//v///v///v/+9Ors4r/q2a3eyYbf
wnzUsV3WsFvOqUHInSrFninGnyrGnSny377//v/+/////f7+/////v/u4b7GnSnHnirHnCvGnyrN
qD7UsVXSs1nfwn7gyYbs2a/r4b379Or///3///////3///////////3////////+//////3+/vz/
///+/v7///3+//////3//f7////////+//v+/////f7+/v/+//3///3/////////////////////
////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////
stonesrock
Registered: Feb 27 2007
Posts: 54
Ah, the "garbage" code only seems to occur when I select Imbed Image Data.

In my data source XML, it is just a node as others, but in the past when I've done this functionality, if I have multiple instances I want to send, it has worked??? You stated that " Repeated nodes in the original XML should be marked as multiple instance nodes in the Datasets" Here is what I have in the XML code:

Not sure what I'm missing now. Thanks again!
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Here's what it looks like in my example. "Stuff" is the repeated subform.

The sample XML actually contained multiple instances of "Stuff".

Thom Parker
The source for PDF Scripting Info
[url=http://www.pdfScripting.com]pdfscripting.com[/url]

The Acrobat JavaScript Reference, Use it Early and Often
[url=http://www.adobe.com/devnet/acrobat/javascript.php]http://www.adobe.com/devnet/acrobat/javascript.php[/url]

Thom Parker
The source for PDF Scripting Info
www.pdfscripting.com
Very Important - How to Debug Your Script

stonesrock
Registered: Feb 27 2007
Posts: 54
thomp,

Thanks for the help, this did the trick. In my XML sample file, I added another record and it did at the maxOccur. I then did an email test and the multiple instances now work in the XML output!

Again, thanks for your help on this, I really appreciate it!!!
zelt007
Registered: Nov 7 2011
Posts: 1
Good info for me!