Trying to import XML into PDF subform

I have a very big form where the first page is pre-filled with data in livecycle service, but then users want to import an xml file to populate the data in the rest of the form.  If I use the xfa.host.importData () it is the xml but overwrites all pre-populated data.  If there is a default value that is specified for a field, it it resets the default value.

Is there a way to control which part of the form is updated by the import?  Or is there a way to protect the pre-filled data so that it is not replaced?  I tried to set readOnly, non-interactive, protected areas, etc., but it seems not to matter.  I also thought trying to dynamically set the defaultValue properties, but this does not seem to be supported.

I looked the loadXML method as well, but don't know how to implement - or if it's even feasible option with this use case.

I don't know that it can be accomplished if write us a script to parse the XML manually in each field, but there are several hundred fields so I hope that there is a better way... Any suggestions?

Thank you!

I remember a client asks me something like that once but being too busy and give it a low priority, I decided to shelf it.

Now that I'm not busy, I'm happy I came across your question and took a few hours to concoct it. Here's how the script works:

(1) the form saves the current xml of the form all data in a global variable

(2) it then prompts the user for the xml file to import into the form. Replace all data in the form

(3) form saves the xml data for just the subform to which the newly imported data applies to in another variable

(4) charging the xml saved from the first variable just before importation took place

(5) then uses the second variable with the data in the subform and crushes the subform

The following code is also a few assumptions:

(1) your form is bound to a schema

(2) subforms can be used as a parameter to the mergeData function no fields

(3) the used subform must itself be bound to a data node. Not only the areas that it contains.

Put this button even your "import":

//Save the current state of the form in a global Acrobat variable
global.formXML = sanitizeData(xfa.datasets.data.saveXML('pretty'));
//Show the import XML dialog
xfa.host.importData();
//Removes the xml header
function sanitizeData(xfaData) {
 xfaData = xfaData.replace(/<\?xml\sversion="1.0"\sencoding="UTF-8"\?>/,"");
    return xfaData;
}

Because the form asking for a time to merge the data before execution is continued, the following must stay in the case of the form: ready:

if (typeof(global.formXML)!='undefined')
 mergeData(YourSubformHere);//Enter the SOM expression of the subform you want to import
function mergeData(oSubform){
 //Save the subforms data
 var subformXML = sanitizeData(xfa.datasets.data.resolveNode(oSubform.dataNode.somExpression).saveXML('pretty'));
 //reload the entire forms data from the xml import in the click event
 xfa.datasets.data.loadXML(global.formXML,1,1);
 //global variable no longer needed
 delete global.formXML;
 //Load the new subform data stored in variable subformXML
 xfa.datasets.data.resolveNode(oSubform.dataNode.somExpression).loadXML(subformXML,1,1);
 xfa.form.remerge();
}
//Removes the xml header
function sanitizeData(xfaData) {
 xfaData = xfaData.replace(/<\?xml\sversion="1.0"\sencoding="UTF-8"\?>/,"");
    return xfaData;
}

A lot of things to take, but I hope it solves your problem.

Let me know.

Kyle

Tags: Adobe LiveCycle

Similar Questions

  • Is it possible to import xml into Adobe Muse to fill the content similar to InDesign?

    Is it possible to import xml into Adobe Muse to fill the content similar to InDesign?

    The only way I see that this would be possible through the use of JS that you can insert by using the object-> the option Insert HTML code, you can retrieve the XML to the HTML from here - http://www.w3schools.com/xml/xml_to_html.asp

    In order to check this, simply download the sample XML file from the following location - http://www.w3schools.com/xml/cd_catalog.xml and save it somewhere locally. Now to add this file to your Muse project using the file-> add files to the download option, then it appears in the active panel.

    Add the code to your page and update the path that references the file cd_catalog.xml to assets/cd_catalog.xml. Now on the preview of the page in the browser, you should see the HTML populated from the XML.

    Thank you

    Vinayak

  • "Not able to import images into Lightroom" file could not be read.

    Cat walks on laptop and online I found 1 answer where files could not be read and the response has been excellent but I do not understand what setting

    Loril salvation,

    Please make sure that you have read and write permissions on the folder where you are trying to import images into Lightroom.

    Also try to change the location of import and then try

    Make sure you update to Lightroom to the latest version 2015.6.1/6.6.1.

    Concerning

    Tanuj

  • Animate CC import &amp; xml

    I recently changed my CS4 to animate centuries previously, I imported xml data in to dynamic text fields using the following steps:

    var xmlData:XML = new XML();

    var theURL_ur:URLRequest = new URLRequest ("affiche.xml");

    var loader_ul:URLLoader = new URLLoader (theURL_ur);

    loader_ul.addEventListener ("complete", fileLoaded);

    function fileLoaded(e:Event):void

    {

    xmlData = XML (loader_ul.data);

    CAM_txt. Text = xmlData.CAM;

    CAL_txt. Text = xmlData.CAL;

    CPM_txt. Text = xmlData.CPM;

    CPL_txt. Text = xmlData.CPL;

    DAM_txt. Text = xmlData.Double_AM;

    DAL_txt. Text = xmlData.Double_AM_limite;

    DPM_txt. Text = xmlData.Double_PM;

    DPL_txt. Text = xmlData.Double_PM_limite;

    }

    I created a HTML5 canvas using the same script and the web page does not appear anything (a blank page). Can I import xml into an HTML5 canvas? If Yes, can someone help me with the coding?

    Thank you

    Jody S

    found this on another forum from adobe:

    How can I load external XML content to my HTML5 doc?

  • All my songs on my iPhone are disabled when trying to import into GarageBand

    All my songs on my iPhone are disabled when trying to import into GarageBand.

    All of these songs in my music tab before you do my songs in GarageBand are inaccessible.

    The songs are disabled and not able to add or import them

    If anyone can help with this.

    Thanks for the help in advance

    What kind of songs do you have in your Music.app on the iPhone?  You can use any song in GarageBand, with digital rights not assigned, no music Apple or bought songs that have the file protected AAC audio file type. Alos, the songs must be stored locally on your iPhone. If you use iTunes game, download the songs first for the iPhone, before trying to use in GarageBand.

  • How to convert XML into a PDF file?

    I use Adobe Acrobat X Pro 10.0.  I saved a PDF file in an XML 1.0 document.  I would like to be able to send this XML document and have the recipient opened the XML into a PDF file.  Does anyone know how to do this?

    Thank you

    Hello hilaryb49990629,

    Thanks much for posting on the Adobe forums.

    I'm sorry, but XML is not a type of file Adobe Acrobat/Reader can open. It can be opened in a browser or Editor (such as Notepad) to view its content.

    Kind regards

    Ana Maria

  • import fails while trying to import userdefinedfields.xml

    All,

    I'm trying to import userdefinedfield.xml from dev to QA environment and import fails with the error message below.

    [11:36:44:892 EAST of xx/07/13] 00000051 SystemOut O ERROR, 15 July 2013 11:36:44, 892, [XELLERATE. DATABASE], CHANGE ALTER TABLE USR

    java.sql.SQLException: ORA-00904: invalid identifier

    [15/07/13 11:36:44:907 EST] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataBase/substitute is entered.

    [11:36:44:907 EAST of xx/07/13] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataObj:handleErr - data: poError.isAction - value: F

    [11:36:44:907 EAST of xx/07/13] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataObj:handleErr - data: poError.isCode - value: SDK. MODCOL

    [11:36:44:907 EAST of xx/07/13] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataObj:handleErr - data: poError.isDescription - value: error editing a column.

    [11:36:44:907 EAST of xx/07/13] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataObj:handleErr - data: poError.isRemedy - value: check for the valid column length variation

    [11:36:44:907 EAST of xx/07/13] 00000051 SystemOut O DEBUG, 15 July 2013 11:36:44, 907, [XELLERATE. SERVER], class/method: tcDataObj:handleErr - data: poError.isDetail - Value: com.thortech.xl.orb.dataaccess.tcDataAccessException: DB_WRITE_FAILEDDetail: SQL: ALTER TABLE USR CHANGE Description: ORA-00904: invalid identifier

    SQL State: 42000Vendor Code: 904Additional Debug Info: com.thortech.xl.orb.dataaccess.tcDataAccessException

    [11:36:44:923 EAST of xx/07/13] 00000051 SystemOut O ERROR, 15 July 2013 11:36:44, 923, [XELLERATE. DDM. [IMPORT], error, editing a column.

    [11:36:44:923 EAST of xx/07/13] 00000051 SystemOut O ERROR, 15 July 2013 11:36:44, 923, [XELLERATE. DDM. IMPORT] Exception when importing

    com.thortech.xl.ddm.exception.DDMException: cannot save the DataObject for SDC

    at com.thortech.xl.ddm.instance.TableInstance.finishDataObject (unknown Source)

    We are not able to reproduce the problem in other development/test environments.

    Please suggest if you have some idea on what may be the problem.

    Thank you

    Olivier

    can disable you the caching of metadata, restart the server of the IOM, and then try importing the xml file.

  • Acrobat standard 9: train and import xml

    Hi all, is it possible to import xml data into a pdf with acrobat 9 standard form?

    I n t have the menu "shape".

    A friend can import xml in acrobat 8 standard, I tried to install version 8, but I can't find any menu of shape too...

    In the document online, it seems possible by using the shape menu...

    Thanx

    For questions about Acrobat 9 Standard, use the Acrobat forum.

    Adobe Reader cannot import form data.

  • Import XML... vs .importXML [JS CS4]

    I am trying to import an XML file programmatically, but the results are not what I expected.

    For example, consider this file sample.xml

    < people >
    < person pid = "0" >
    < name > John < / name >
    < 54 > < / age >
    < date string "birthday" = >
    <>day 14 < / day >
    < month > may < / month >
    < year > 1956 < / year >
    < / date >
    < / person >
    < person pid = "1" >
    < name > Sally Smith < / name >
    ...

    If I run this code, importSample.jsx

    a new document has been already created by program
    myDocument var = app.documents.item (0);
    myDocument.xmlElements [0] .importXML (file (Folder.desktop + "/ sample.xml"));

    I get this:

    But if I use file > import XML format... I get this, which is what I want:

    The examples I find to import XML script are all the same - most of the results for the script turn own Adobe PDF guides. XML rules examples in the Guide to Scripting InDesign CS4 PDF (Javascript) uses similar XML format in his example, but requires it to be imported already. What I'm missing here?

    At this point, I'm happy to let the XML experts...

    I wasn't the copy of your XML file into a new file and run the script in two lines to import it. It seems a settings that you set in the full script it makes go Goo-Goo. Maybe you can remove a line at a time until it works... (a.k.a. "debugging by exclusion")

  • Can't view the data after loading the XML into RTF model

    Hi friends

    I am unable to view data in PDF after loading the XML into RTF model
    After I load the XMl file to my model
    The complement of the tab, I'm trying to get a glimpse of the output as pdf/xml etc, but he throws and error
    Window does not
    'C:\DOCUME~1\SYSNAME~\LOCALS~\APPLIC~1\Oracle\BIPUBL~1\TEMPLA~\tmp\3513518782149421out.pdf214921out.pdf '. Make sure you typed the name correctly and then try again. To search for a file, click the Start button and click Search

    I gave the name correctly only, but don't know y it displays error I have to reinstall the Office of Oracle BI Publisher once more please advice me what needs to be done to solve my problem of my PC

    Thank you
    Thiliban

    It seems that the problem is with the working directory of the BIP Office.

    If you have administrator access to the computer, please do the following:
    1 Windows-> Run-> regedit
    2. find the value of the next entry
    Publisher\Template HKEY_CURRENT_USER\Software\Oracle\XML for Word\TB_WORK_DIR generator
    3. change your path C:\DOCUME~1\SYSNAME~\LOCALS~\APPLIC~1\ORACLE\BIPUBL~1\TEMPLA~\tmp

    See you soon,.
    ND
    Use the buttons "useful" or "correct" to award points to the answers / mark the thread as answered, if your question is answered.

  • Problems with importing XML of the FCP 7 to Premiere Pro CS6

    Afternoon everyone.

    I am currently trying to import an FCP 7 project I want now, edit and tweak in Premiere Pro (have recently realized I am using first a lot more so want to start earning a full switch).

    I put together my project initial of the FCP and exported via XML (Apple Interchange Format, Version 5) and imported into an empty Premiere Pro project. However it comes to import window is progressing well at 100% and then throws this error message me, and I can't understand why.

    Screen Shot 2013-01-07 at 14.56.13.png

    I tried to export an XML file for the entire project, with all the bins/sequences/clips, etc. I also tried individual sequences/containers, and none of them want to import.

    Anyone know why this is happening?

    Thank you

    Adam

    Start here:

    FAQ: Why some codecs and sequence presets missing my Premiere Pro installation?

    If this is not resolved, report back.

  • I tried to import my vcard to icloud, which is in format .vcf. It is projection 300 contacts could not be imported because there was a problem to read. What should I do to import them.

    I tried to import my vcard to icloud, which is in format .vcf. It is projection 300 contacts could not be imported because there was a problem to read. What should I do to import them.

    You could try to export your contacts into smaller groups

  • I am trying to import my Internet Explorer and the command IMPORT menu FILE is greyed out (unavailable)

    I am trying to import my Internet Explorer Favorites and the element menu to import on the FILE menu is greyed out (unavailable)

    This menu item is dimmed in the private browsing mode.

    http://support.Mozilla.com/en-us/KB/private+browsing

    You can export your IE Favorites and then import this file into Firefox. Works better than the 'import', IMO.

    In Internet Explorer:

    File > Import/Export - Export to HTML file

    then in Firefox:

    Bookmarks > show all bookmarks-> import and backup - import HTML... = HTML file

  • When I tried to import pictures from my camcorder videos seem to be import of Strontium.  After finished importing is not found the videos at all.  Any ideas?

    When I tried to import pictures from my camcorder videos seem to be importing into "Strontium".  After finished importing is not found the videos at all.  Any ideas?

    What is "strontium"?

    There are 9 different versions of iPhoto and they run on 10 different versions of the operating system. Tips and tricks for dealing with issues vary depending on the version of iPhoto and the version of the operating system. In order to get help, you need to give as much information as possible. Include things like:

    -What version of iPhoto.

    -What version of the operating system.

    -Details. Full, a description of the problem as you can. For example, if you have a problem with export, then explain by describing how you try to export and so on.

    -History: Is it going hard? Everything has been installed or removed? -Are there any error messages?

    -Have what measures you already tried to solve the problem.

    -Something unusual on configure your? Or how you use iPhoto?

    Anything else you can think of that could help someone understand the problem you have.

  • Why can't I find a song on my computer and then import it into windows movie maker

    OK, I have windows XP and im trying to do a movie with windows movie maker, the problem is that I can't find a song in my files from the computer to import it into movie maker. I imported the song on a cd, why can't I? is there anyway to find the song and then import it to movie maker. * Note, the song is in iTunes, but I can't find it on my computer *.

    Hi JoclyenWooten,
     
    ITunes files are stored in the following location:
    C:\Documents and utilisateur\Mes Music\iTunes\ Documents\My Settings\nom
     
    When you import the Movie Maker file, navigate to the location given for import files.

Maybe you are looking for