Expand my Community achievements bar.

How to parse xml clientside in a PDF

Avatar

Former Community Member
I need to polulate a drop down and then a listbox with data from a hidden field. The data is different every time i load the form so i have to use Livecycle forms to put the xml in a hidden field.



Doesn anyone have an example that parses xml client side in the PDF?
2 Replies

Avatar

Former Community Member
Have a look at the XMLData Object in the Acrobat javascript reference manual. Pg 643. This object can load XML Data through the XFA DOM using the parse Method. I mainly use it for XFA style XML, but I think it can consume arbitrary XML as well.

Avatar

Former Community Member
It can, and if you are taking the XML from a hidden field then that's the way to go.



But if you're using Forms to merge the XML in, you really don't need to have a hidden field bound to it. You could just use script against the data DOM and do it directly into drop down and list box. Basically you'd use resolveNodes() to get a NodeList of the ndoes you are interesting in. The loop through the NodeList and add the values to your fields.



Chris

Adobe Enterprise Developer Support