Highlighted

Custom XML

Avatar

Avatar

Piotr_Stapp

Avatar

Piotr_Stapp

Piotr_Stapp

06-10-2008

I would like to put into XFA an XML part with custom data. It will be used in javascript. Any ideas how to do this?

Thanks for help

Replies

Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

07-10-2008

If you merge XML onto the template that is not used in bindings to individual fields it will be put into the Data Dom and will be included in a submission (unless there is a schema involved). Once it is in the DOM you can access it using xfa.datasets.data and navigate to the appropriate node. Note that once you get ot the appropriate node use the value method to get the actual node value.
Highlighted

Avatar

Avatar

Piotr_Stapp

Avatar

Piotr_Stapp

Piotr_Stapp

08-10-2008

But after data import my custom data will be deleted?
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

09-10-2008

Do you want to create a separate node in the data dom that you can use instead of xfa.datasets.data?
Highlighted

Avatar

Avatar

Piotr_Stapp

Avatar

Piotr_Stapp

Piotr_Stapp

11-10-2008

Exactly
Highlighted

Avatar

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692

Avatar

pguerett

Total Posts

7.7K

Likes

611

Correct Answer

692
pguerett

12-10-2008

There is a loadXML method that you can use to load your XML in the data dom. There are 2 parameters that you can pass that tell the function whether you want to overwrite any existing nodes and whether you want to load children or not. I do not have the docs in front of me so I do not know which is which, but if you want to load your xml at the same level as the data node then you can use this command:



xfa.datasets.loadXML(string_output.rawValue, false, false)



Where string_output.rawValue is the field that holds the XML that you want to merge.



I will post the info on those 2 params when I return to the office.