Expand my Community achievements bar.

July 31st AEM Gems Webinar: Elevate your AEM development to master the integration of private GitHub repositories within AEM Cloud Manager.

adding additional instances of xml tags/nodes

Avatar

Former Community Member
Hi,<br /><br />I have an xml structure attached to a generated pdf that looks something like this:<br /><br /> <page><br /> <page_item><br /> <page_no>0</page_no><br /> <page_read_yn>N</page_read_yn><br /> </page_item><br /> </page><br /><br />and I would like to insert some additional <page_item> nodes into this structure. I have tried using the instanceManager as shown, but I am getting the message that "xfa.record.page.page_item.instanceManager has no properties".<br /><br />try {<br /> xfa.record.page.page_item.instanceManager.addInstance(1); <br />} catch(e) {<br /> app.alert(e);<br />}<br /><br />Just wondering how to add data nodes to the xml attached to the form.<br /><br />thanks,<br />John
4 Replies

Avatar

Former Community Member
John,

The InstanceManager is for adding instances of subforms, not instances of XML nodes. To add

instances of the subform, substitute 'xfa.form' for 'xfa.record' in your code.



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
Hi Justin,



thanks for the reply.



I understand that the instanceManager is used for adding instances of subforms. I am using this effectively in the documents that I have created. I was looking for the xml equivalent of the instanceManager. In talking with premium support, the tech did not have an answer for me, so I thought that I would try the forum.



I found a vague reference on one of the replies that suggested this was possible.



John

Avatar

Former Community Member
John_Revoy@adobeforums.com wrote:

> Hi Justin,

>

> thanks for the reply.

>

> I understand that the instanceManager is used for adding instances of subforms. I am using this effectively in the documents that I have created. I was looking for the xml equivalent of the instanceManager. In talking with premium support, the tech did not have an answer for me, so I thought that I would try the forum.

>

> I found a vague reference on one of the replies that suggested this was possible.

>

> John



John,

Look at the XMLData object in the Acrobat JavaScript Scripting Reference. This might give you

the capability you're looking for. I've never used it...I just know of its existence.



--

Justin Klei

Cardinal Solutions Group

www.cardinalsolutions.com

Avatar

Former Community Member
I don't understand exactly what you are trying to do (specifically, I don't understand which DOM you're manipulating), but I believe these two examples are related and should be helpful:



Adding new data to an existing DATA DOM

http://partners.adobe.com/public/developer/en/livecycle/lc_append_data_sample.zip



XML Handling in Acrobat JavaScript

www.windjack.com/DownLoads/XMLData_Example.pdf