PDF XFA DOM versus HTML DOM elements – a tiny comparison

As you may aware of that displaying XFA based PDF files in HTML format is a critical part in the PDF to HTML conversion process. XFA supports Ecma Script 357 specification that was deprecated by World Wide Web Consortium (W3C). In order to overcome this issue I decided to add and override some properties of Element object in HTML DOM to make XFA Node methods available in HTML Elements.

The box below summarizes some interesting differences.

XFA Methods/PropertiesHTML (Element/Node/Attribute) Methods/Properties
 parent parentNode
 className nodeName
 nodes childNodes
 name nodeName
 clone(booleanParam) cloneNode(booleanParam)
 append(objectParam) appendChild(objectParam)
 insert(newNode,existNode) insertBefore(newNode,existNode)
 remove(objectParam) removeChild(objectParam)
 classAll getElementsByTagName(callerNodeName);
 createNode(stringParam) createElement(nodeName)
 getElement(name,index) getElementsByTagName(name)[index]
 remove(objectParam) removeChild(node)

XFA dom has array type architecture that is used to access child elements with the same name but javascript does not have this feature and it has to use resolveNode or resolveNodes methods to access the node objects. Please read this article for the usage of resolveNode subroutine.

Hope this information is helpful..

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 (TwitterFacebook and Google+) or the Blog RSS.

Related Posts:

  • No 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>