Dynamic XFA/PDF to HTML – resolveNode method

If you are an XFA expert you may aware that XFA utilizes javascript and FormCalc as scripting languages for handling dynamic XFA forms.

XFA Form resolveNode

An XFA form with and example of resolveNode.

In this article we do an overview of some factors that have to be taken into consideration prior to implementing resolveNode subroutine in your code.

Why resolveNode?

Adobe lifecycle designer follows the Ecma Script 357 specification to represent the SOM model structure.

in simple example :…..

<class>

<student><name>john</name></student>.

<student><name>david</name></student>

</class>

in case If you want to access the name of second student then you need to pass the query as “class.student[1].name” for access

But such an array based access algorithm is not available in regular javascript; therefore resolveNode method is implemented to reference the node information from ecma script 357 supported script.

resolveNode method plays major role in adding, removing, and moving subform instances on the fly:

A nice html implementation example of this functionality can be found here:

http://files.idrsolutions.com/xfa/

Have a go at trying to add and delete items from purchase order form

Steps to handle resolveNode function:

The following are steps that simplify the process of handling resolveNode functions.

1. Write down the short representation of your full XFA form model by removing internal node structure of fields; so you can track the method insertion point and the caller of the function very quickly.

2. Always use descendant search prior to ascendant search: if you do not found the required item in descendants then move to the ascendant nodes;

3. Use parent by parent search while traversing to ascendant nodes:

4. Check for [*] symbol : if you come across this sign try to traverse through all the nodes which has the same named descendants of particular node;

5. check for “..” symbol for descendant search and “.parent” for accessing parent node.

Hopefully you may find this information helpful and next time I will be taking a look at the InstanceManager functionality in next article; that will help you to understand how to add and delete forms in custom made html representation of XFA forms.

This post is part of our “XFA Articles Index” in these articles, we aim to help you understand XFA.

If you’re a first-time reader, or simply want to be notified when we post new articles and updates, you can keep up to date by social media (Twitter, Facebook and Google+) or the Blog RSS.

 

Related Posts:

The following two tabs change content below.

suda

Java EE developer at IDRSolutions
Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions. He is a keen science-fiction fan in his spare time.
suda

About suda

Suda is the Senior Java EE Developer at IDR Solutions, and specialises in XFA, Fonts, True-Type Fonts, application servers and conversions.
He is a keen science-fiction fan in his spare time.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes:

<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>