Parsing XML with Adobe Javascript
I am working with the standard SQL QPAC to get data list from a database. As we are aware already that the standard SQL APAC is unable to access more than one rows at a time but I use the "FOR XML AUTO" in my SQL statement so that entire rows would be returned into the XML format.Currently, I only require to parse the XML and put the desired values into my drop-down list.
Does somebody have any script demo through which I can parse XML from within LiveCycle ??
Re: Parsing XML with Adobe Javascript
Do you wanted to parse this in a script qpac ? If yes, then you can collect the XML in an xml process variable and then after attach the function as getProcessDataValue() from PATExecutionContext to access a Document object for the DOM.
You also need to go for a visit at the JavaDocs which came with the LiveCycle Workflow SDK. Within the Documentation/apiLiveCycle_ Workflow_SDK_API_Reference. In the script QPAC the PATExecutionContext is an implicit object retrieved within the patExecContext. In a customized QPAC, this is one of the parameter to the execute method.
Re: Parsing XML with Adobe Javascript
I have tried to assign the following XML into an xml variable, but I got an error between these instead: 12Otis3
Do you know precisely, how to perhaps found the exact XML evaluation from a SELECT statement which will move into an XML variable? I have used "SELECT CLIENT_NAME as attribute from clients as list ORDER BY CLIENT_NAME FOR XML auto, elements" and I am working with a standard SQL QPAC to evaluate the XML results. Once, I receive the XML in perfect manner into the XML variable, I will try to use the getProcessDataValue() method.
Re: Parsing XML with Adobe Javascript
Hi shiman, If you are running with the problems and trying to solve it in this method ,there are another option in this case and you also can go for that. you can download the SQLPlus QPAC, which will facilitate you to iterate over a result set and format the output according to the number required , including a easy and reliable comma separated list. Then after, you can then execute a simple script in the form to unzip the list to tag the values in the dropdown menu..
Re: Parsing XML with Adobe Javascript
This may be just as easy to write a QPAC which fires the query and displayed the output a comma-delimited list as a string. You could then have the form take that string as a invisible section and parse this into the drop-down list in the same way that Work-flow facilitates the submission options drop-down list.
Re: Parsing XML with Adobe Javascript
Thanks guys,
You all have given me a better suggestion and solutions which I can try someday. I actually mean that, but my intention with such specific work-flow is to work with only utilities which I get out of the box. I actually desired to know the dependent components well so that I get a complete understanding of what the suggested QPACs can and unable to do.
That method through which I get to know about the use of some loosely documented strategies such as getProcessDataValue(). Forgive my ignorance, can somebody please suggest me how to make a script that calls to this one method, if you have used this previously?