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/Properties | HTML (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..