Expand my Community achievements bar.

Learn about Edge Delivery Services in upcoming GEM session

Custom XML

Avatar

Level 2
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
5 Replies

Avatar

Former Community Member
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.

Avatar

Level 2
But after data import my custom data will be deleted?

Avatar

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

Avatar

Former Community Member
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.