I need to create a pdf form where you can click through different records from an xml data source, similar to the ODBC version shown here.
For ODBC the following APIs were used:
xfa.sourceSet.DataConnection.last();
xfa.sourceSet.DataConnection.first();
xfa.sourceSet.DataConnection.previous();
xfa.sourceSet.DataConnection.next();
xfa.sourceSet.DataConnection.addNew();
xfa.sourceSet.DataConnection.delete();
However xfa.sourceSet is not available with XML data connection(, at least in ES4).
How can I create this same functionality with XML Data Source?
Here is a simplified version of the form and xml:
<?xml version="1.0" encoding="UTF-8"?>
<bookstore>
<book category="cooking">
<title lang="en">Everyday Italian</title>
<author>Giada De Laurentiis</author>
</book>
<book category="children">
<title lang="en">Harry Potter</title>
<author>J K. Rowling</author>
</book>
<book category="web">
<title lang="en">XQuery Kick Start</title>
<author>James McGovern</author>
</book>
<book category="web" cover="paperback">
<title lang="en">Learning XML</title>
<author>Erik T. Ray</author>
</book>
</bookstore>
If I manually change the binding for subform book
(shown with the blue arrow in screenshot) to $record.book[1]
the details for the second record are shown in the generated pdf. Is it possible to change the bindings via javascript?
Here is a link to a copy of the form and the xml.