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

reading XML output from a http request call

jamesraceson
Registered: Oct 22 2007
Posts: 6

I am using LiveCycle Designer version 8 on a Windows XP machinge (SP 2). My challenge is this, I am trying to retrieve information from an http request call that returns XML to the browser. It doesn't create an actual XML file but the output is returned in XML format. What I want to do is pick out pieces of the XML data and populate the form with the data returned. I saw documentation on the xfa.host.importData("mydata.xml") but I don't have an actual XML file to read, just the output from the http request call that is in XML format. Is there a way to combine some functions so that the http request is inside of the importData call? Is there a better way to try to accomplish my goal? Any and all help would be greatly appreciated as I am against the wall on finding a way to make this work.

My Product Information:
LiveCycle Designer, Windows
thomp
Expert
Registered: Feb 15 2006
Posts: 4411
Acrobat will automatically populate a form with XML data passed in from an HTTP request/response if the http request was initiated by a submit form action and the form is setup to read the XML gramar passed in.

The form has to be bound to some XML schema. The form is setup for handling XML by creating a new "Data Connection" in "Data View" tab in designer. Select either XML schema or Sample XML, use the xml gramar passed back in the HTTP request. Then bind the form fields to nodes in the XML. Do this from the Binding tab on the Object panel.

That should do the trick.

There are lots of variations on the method and other ways to do it. For example, much of the binding can be set up dynamically with JavaScript, but this is a pretty advanced codding.

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