Extracting Data From Xml File

Recently I was given the following xml

geebee@yahoo.com
tblue@yahoo.com
apink@yahoo.com

The customer wanted to email the persons listed in the emails element. They wanted to use the email component provided by livecycle. The email component takes a comma separated string when you want to email multiple people. So I used setValue component to extract the emai id’s and put them into a list. The list was then converted into a comma separated string of email addresses.
I also used the script component to accomplish the same. I have put both the solutions as file attachment . Feel free to download and deploy the lca and try it out
Click here to get the pdfhandling-repeating-elements4

Advertisements

10 responses to “Extracting Data From Xml File

  1. Hi,

    I have an issue with referencing through code objects within a repeated sub-form.
    I was hoping if you can help me with it which would be very much appreciated.

    The sub-form is being added dynamically and contains several objects within.
    I need to hide/show one the objects (drop-down list) within the sub-form and
    this code works fine in FormCalc, but JaveScript version, which I have to use
    is giving me problems: the code below hides the object in the first instance of the sub-form
    although is called from a subsequently added sub-forms. How do I reference the objects
    in JavaScript in the added sub-form?

    This is the code:
    // Hide/show approver ddl
    var approveReq = this.rawValue;
    if (approveReq == 1) {
    xfa.form.REQUEST.MainSubForm.Systems_Subform.SYSTEM.Approver.presence = “visible”; }
    else {
    xfa.form.REQUEST.MainSubForm.Systems_Subform.SYSTEM.Approver.presence = “invisible”; }

  2. Hi,
    If I have CDATA in my xml such as:
    ]]>

    in livecyle, can I have any way to just get the value of “Test Database”? instead of including the CDATA…

    Thanks,
    Joanna

  3. Hello,
    If I have CDATA in the XML element such as:

    Is there any way in livecycle I can only get the value of “Test”, instead of including “CDATA”?

    Thanks,

    Joanna

  4. Dear Girish,
    I created a form using Lifecycle Designer ES 8.2, Adobe User Rights is enabled, and the form is distributed via Acrobat.com using Adobe Pro v9 Form Tracker. I am receiving completed returned forms OK in Adobe, but when I export data to xml and import into Excel, each form is being duplicated multi times as seperate rows in excel (as many as 30 times!). These columns have headings like “ns1:APIVersion” or “style” or ns1:spec”, and the data under these headings is different in each duplicate row (data for my fields is the same across all rows for each form represented).

    I have created and used many Adobe forms and not come across this before. Any idea what’s going on?
    Thxs, Leonie

  5. Hi,

    First of all, thanks for this useful tip.
    I tried to apply it to my process but keep getting stall because my xml file which was created from another process by using the component “Query for Multiple Rows as XML” is different from yours as seen below. I’ve tried to change the nodes but still not working right.
    —————begin xml file——-

    john.smith@abc.com

    jane.smith@abc.com

    ————-end of xml file ——–

    Since the xml file was created from another process and stored on the LC server, how can I call it from your process?

    Can you please help on these.

    Thanks,
    HD

    • Girish Bedekar

      can you please send me your xml file and what data you want to extract from
      mergeandfuse@gmail.com
      thanks
      girish

    • Girish Bedekar

      you need to follow the steps as mentioned below
      you would need to do the following
      using setvalue use the count function to get the count of the person nodes in the xml(This would return 4)

      /process_data/@noOfPersons = count(/process_data/emailsXml/people/person)

      noOfPersons is an variable of type int

      /process_data/emailsXml/people/person[number(/process_data/@counter)]/Email

      where counter is a variable of type int and its default is set to 1

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s