Expand my Community achievements bar.

XFO Objects and embedded xml data

Avatar

Level 2

Hi

Does anyone know if I can embed xml data into an xfo library object? Let me explain...

I have a list-box which is to contain a list of countries of the world as defined in ISO 3166. This is a really long list and provided in an xml document. So I want to keep the xml document as the source of the data.

I want to use the countries list in an address block and save it as a custom object i.e. an xfo, so I can reuse it in different forms.

So my question is: can I embed the xml data into a library xfo object?

Right now the only way I can make the xml/lookup work is by saving my pdf form from LIveCycle Deisgner, then open it in Acrobat Pro and import the xml as form data.

8 Replies

Avatar

Former Community Member

Yes you can. I put together the attached .xfo a while back using iso_3166-1_list_en.xml as the source.

Steve

Avatar

Level 2

Hi Steve

Good to know it's possible! And yeah, thats the country xml data file Im working with too.

But I can't work out how to do it. I wasnt able to use your xfo object in Designer, even after manually adding the element to Designer's ObjLibLayout.xml file, so I can't see in action.

Can you walk me through the process of embedding xml data into an object?

Avatar

Former Community Member

You don't have to mess with ObjLibLayout.xml. Just copy the .xfo to one of the object folders. For example, on my Windows 7 (64-bit) machine my Custom .xfo folder is C:\Program Files (x86)\Adobe\Adobe LiveCycle Designer ES2\EN\Objects\Custom.

Steve

Avatar

Level 2

Yeah that would normally work, but hasnt for some reason. Editing the liblayout file was a last resort.

So how did you embed the xml data into the object?

Avatar

Former Community Member

NotePad. An .xfo is just an .xdp is disguise.

Avatar

Level 2

OK. So I have my form elements (including the country list) wrapped in a subform and to add them to the object library I drag the subform into the libarary (in designer). A dialog pops up asking me what to name it and for a description. I hit enter and its available in my custom object library.

The part I cant figure out is how do I embed the country list xml data into the custom object?

I can open the form with Acrobat Pro then from the menu go Forms -> Manage Form Data -> Import Data... and import the xml file. Then my countries list is populated. Great. I save that pdf and open it in Designer but there appears to be no country data in it again. Only when its opened in Acrobat Pro is the country list populated.

The xfo file you sent me doesnt have any country data inside it (looking at the raw xml), so I can't figure out how to paste the country xml data into the object heirarchy manually.

So how do I embed the xml into form object in designer?

Avatar

Former Community Member

I created MyCountries.xfo by opening C:\Program Files (x86)\Adobe\Adobe LiveCycle Designer ES2\EN\Objects\Custom\U.S. States.xfo in a text editor and replacing the applicable data. I then saved MyCountries.xfo in C:\Program Files (x86)\Adobe\Adobe LiveCycle Designer ES2\EN\Objects\Custom and the object is available as a Custom object in Designer.

MyCountries.xfo contains all the countries from the ISO XML source file. When I open the .xfo in NotePad++ (or any text editor) I can see the list of countries as depicted in the .xfo excerpt below starting at line 49.

Untitled.png

Here is the ANSI encoding of the MyCountries.xfo.

<?xml version="1.0" encoding="UTF-8"?>

<?xfa generator="AdobeLiveCycleDesigner_V8.2" APIVersion="2.8.7309.0"?>

<xdp:xdp xmlns:xdp="http://ns.adobe.com/xdp/">

<template xmlns="http://www.xfa.org/schema/xfa-template/2.6/">

   <subform>

      <pageSet>

         <pageArea name="snippet">

            <desc>

               <text name="name">Countries</text>

               <text name="description">Countries - Displays a drop-down list populated with Country names.</text>

               <text name="version">8.2.1.3158.1.475346.466429</text>

            </desc>

            <field h="8.9916mm" name="Country" w="88.9mm">

               <ui>

                  <choiceList>

                     <border>

                        <edge stroke="lowered"/>

                        <edge stroke="lowered"/>

                        <edge stroke="lowered"/>

                        <edge stroke="lowered"/>

                     </border>

                     <margin/>

                  </choiceList>

               </ui>

               <font typeface="Myriad Pro"/>

               <margin bottomInset="0.9906mm" leftInset="0.9906mm" rightInset="0.9906mm" topInset="0.9906mm"/>

               <para marginLeft="0pt" vAlign="middle"/>

               <caption reserve="15.24mm">

                  <font typeface="Myriad Pro"/>

                  <para marginLeft="0pt" marginRight="0pt" textIndent="0pt" vAlign="middle"/>

                  <value>

                     <text>Country</text>

                  </value>

               </caption>

               <border>

                  <edge presence="hidden"/>

                  <edge presence="hidden"/>

                  <edge presence="hidden" thickness="0.0762mm"/>

                  <edge presence="hidden"/>

                  <corner presence="hidden" thickness="0.0762mm"/>

                  <corner presence="hidden" thickness="0.0762mm"/>

                  <corner presence="hidden" thickness="0.0762mm"/>

                  <corner presence="hidden" thickness="0.0762mm"/>

               </border>

               <value>

                  <text>AL</text>

               </value>

               <items>

<text>AFGHANISTAN</text>

<text>ÅLAND ISLANDS</text>

<text>ALBANIA</text>

<text>ALGERIA</text>

<text>AMERICAN SAMOA</text>

<text>ANDORRA</text>

<text>ANGOLA</text>

<text>ANGUILLA</text>

<text>ANTARCTICA</text>

<text>ANTIGUA AND BARBUDA</text>

<text>ARGENTINA</text>

<text>ARMENIA</text>

<text>ARUBA</text>

<text>AUSTRALIA</text>

<text>AUSTRIA</text>

<text>AZERBAIJAN</text>

<text>BAHAMAS</text>

<text>BAHRAIN</text>

<text>BANGLADESH</text>

<text>BARBADOS</text>

<text>BELARUS</text>

<text>BELGIUM</text>

<text>BELIZE</text>

<text>BENIN</text>

<text>BERMUDA</text>

<text>BHUTAN</text>

<text>BOLIVIA</text>

<text>BOSNIA AND HERZEGOVINA</text>

<text>BOTSWANA</text>

<text>BOUVET ISLAND</text>

<text>BRAZIL</text>

<text>BRITISH INDIAN OCEAN TERRITORY</text>

<text>BRUNEI DARUSSALAM</text>

<text>BULGARIA</text>

<text>BURKINA FASO</text>

<text>BURUNDI</text>

<text>CAMBODIA</text>

<text>CAMEROON</text>

<text>CANADA</text>

<text>CAPE VERDE</text>

<text>CAYMAN ISLANDS</text>

<text>CENTRAL AFRICAN REPUBLIC</text>

<text>CHAD</text>

<text>CHILE</text>

<text>CHINA</text>

<text>CHRISTMAS ISLAND</text>

<text>COCOS (KEELING) ISLANDS</text>

<text>COLOMBIA</text>

<text>COMOROS</text>

<text>CONGO</text>

<text>CONGO, THE DEMOCRATIC REPUBLIC OF THE</text>

<text>COOK ISLANDS</text>

<text>COSTA RICA</text>

<text>COTE D'IVOIRE</text>

<text>CROATIA</text>

<text>CUBA</text>

<text>CYPRUS</text>

<text>CZECH REPUBLIC</text>

<text>DENMARK</text>

<text>DJIBOUTI</text>

<text>DOMINICA</text>

<text>DOMINICAN REPUBLIC</text>

<text>ECUADOR</text>

<text>EGYPT</text>

<text>EL SALVADOR</text>

<text>EQUATORIAL GUINEA</text>

<text>ERITREA</text>

<text>ESTONIA</text>

<text>ETHIOPIA</text>

<text>FALKLAND ISLANDS (MALVINAS)</text>

<text>FAROE ISLANDS</text>

<text>FIJI</text>

<text>FINLAND</text>

<text>FRANCE</text>

<text>FRENCH GUIANA</text>

<text>FRENCH POLYNESIA</text>

<text>FRENCH SOUTHERN TERRITORIES</text>

<text>GABON</text>

<text>GAMBIA</text>

<text>GEORGIA</text>

<text>GERMANY</text>

<text>GHANA</text>

<text>GIBRALTAR</text>

<text>GREECE</text>

<text>GREENLAND</text>

<text>GRENADA</text>

<text>GUADELOUPE</text>

<text>GUAM</text>

<text>GUATEMALA</text>

<text>GUERNSEY</text>

<text>GUINEA</text>

<text>GUINEA-BISSAU</text>

<text>GUYANA</text>

<text>HAITI</text>

<text>HEARD ISLAND AND MCDONALD ISLANDS</text>

<text>HOLY SEE (VATICAN CITY STATE)</text>

<text>HONDURAS</text>

<text>HONG KONG</text>

<text>HUNGARY</text>

<text>ICELAND</text>

<text>INDIA</text>

<text>INDONESIA</text>

<text>IRAN, ISLAMIC REPUBLIC OF</text>

<text>IRAQ</text>

<text>IRELAND</text>

<text>ISLE OF MAN</text>

<text>ISRAEL</text>

<text>ITALY</text>

<text>JAMAICA</text>

<text>JAPAN</text>

<text>JERSEY</text>

<text>JORDAN</text>

<text>KAZAKHSTAN</text>

<text>KENYA</text>

<text>KIRIBATI</text>

<text>KOREA, DEMOCRATIC PEOPLE'S REPUBLIC OF</text>

<text>KOREA, REPUBLIC OF</text>

<text>KUWAIT</text>

<text>KYRGYZSTAN</text>

<text>LAO PEOPLE'S DEMOCRATIC REPUBLIC</text>

<text>LATVIA</text>

<text>LEBANON</text>

<text>LESOTHO</text>

<text>LIBERIA</text>

<text>LIBYAN ARAB JAMAHIRIYA</text>

<text>LIECHTENSTEIN</text>

<text>LITHUANIA</text>

<text>LUXEMBOURG</text>

<text>MACAO</text>

<text>MACEDONIA, THE FORMER YUGOSLAV REPUBLIC OF</text>

<text>MADAGASCAR</text>

<text>MALAWI</text>

<text>MALAYSIA</text>

<text>MALDIVES</text>

<text>MALI</text>

<text>MALTA</text>

<text>MARSHALL ISLANDS</text>

<text>MARTINIQUE</text>

<text>MAURITANIA</text>

<text>MAURITIUS</text>

<text>MAYOTTE</text>

<text>MEXICO</text>

<text>MICRONESIA, FEDERATED STATES OF</text>

<text>MOLDOVA, REPUBLIC OF</text>

<text>MONACO</text>

<text>MONGOLIA</text>

<text>MONTENEGRO</text>

<text>MONTSERRAT</text>

<text>MOROCCO</text>

<text>MOZAMBIQUE</text>

<text>MYANMAR</text>

<text>NAMIBIA</text>

<text>NAURU</text>

<text>NEPAL</text>

<text>NETHERLANDS</text>

<text>NETHERLANDS ANTILLES</text>

<text>NEW CALEDONIA</text>

<text>NEW ZEALAND</text>

<text>NICARAGUA</text>

<text>NIGER</text>

<text>NIGERIA</text>

<text>NIUE</text>

<text>NORFOLK ISLAND</text>

<text>NORTHERN MARIANA ISLANDS</text>

<text>NORWAY</text>

<text>OMAN</text>

<text>PAKISTAN</text>

<text>PALAU</text>

<text>PALESTINIAN TERRITORY, OCCUPIED</text>

<text>PANAMA</text>

<text>PAPUA NEW GUINEA</text>

<text>PARAGUAY</text>

<text>PERU</text>

<text>PHILIPPINES</text>

<text>PITCAIRN</text>

<text>POLAND</text>

<text>PORTUGAL</text>

<text>PUERTO RICO</text>

<text>QATAR</text>

<text>RÉUNION</text>

<text>ROMANIA</text>

<text>RUSSIAN FEDERATION</text>

<text>RWANDA</text>

<text>SAINT BARTHÉLEMY</text>

<text>SAINT HELENA</text>

<text>SAINT KITTS AND NEVIS</text>

<text>SAINT LUCIA</text>

<text>SAINT MARTIN</text>

<text>SAINT PIERRE AND MIQUELON</text>

<text>SAINT VINCENT AND THE GRENADINES</text>

<text>SAMOA</text>

<text>SAN MARINO</text>

<text>SAO TOME AND PRINCIPE</text>

<text>SAUDI ARABIA</text>

<text>SENEGAL</text>

<text>SERBIA</text>

<text>SEYCHELLES</text>

<text>SIERRA LEONE</text>

<text>SINGAPORE</text>

<text>SLOVAKIA</text>

<text>SLOVENIA</text>

<text>SOLOMON ISLANDS</text>

<text>SOMALIA</text>

<text>SOUTH AFRICA</text>

<text>SOUTH GEORGIA AND THE SOUTH SANDWICH ISLANDS</text>

<text>SPAIN</text>

<text>SRI LANKA</text>

<text>SUDAN</text>

<text>SURINAME</text>

<text>SVALBARD AND JAN MAYEN</text>

<text>SWAZILAND</text>

<text>SWEDEN</text>

<text>SWITZERLAND</text>

<text>SYRIAN ARAB REPUBLIC</text>

<text>TAIWAN, PROVINCE OF CHINA</text>

<text>TAJIKISTAN</text>

<text>TANZANIA, UNITED REPUBLIC OF</text>

<text>THAILAND</text>

<text>TIMOR-LESTE</text>

<text>TOGO</text>

<text>TOKELAU</text>

<text>TONGA</text>

<text>TRINIDAD AND TOBAGO</text>

<text>TUNISIA</text>

<text>TURKEY</text>

<text>TURKMENISTAN</text>

<text>TURKS AND CAICOS ISLANDS</text>

<text>TUVALU</text>

<text>UGANDA</text>

<text>UKRAINE</text>

<text>UNITED ARAB EMIRATES</text>

<text>UNITED KINGDOM</text>

<text>UNITED STATES</text>

<text>UNITED STATES MINOR OUTLYING ISLANDS</text>

<text>URUGUAY</text>

<text>UZBEKISTAN</text>

<text>VANUATU</text>

<text>VENEZUELA</text>

<text>VIET NAM</text>

<text>VIRGIN ISLANDS, BRITISH</text>

<text>VIRGIN ISLANDS, U.S.</text>

<text>WALLIS AND FUTUNA</text>

<text>WESTERN SAHARA</text>

<text>YEMEN</text>

<text>ZAMBIA</text>

<text>ZIMBABWE</text>

               </items>

            </field>

         </pageArea>

      </pageSet>

   </subform>

</template></xdp:xdp>

Steve

Avatar

Level 2

Thanks for the replies Steve.

So in summary it appears that xml data bound to a form through a data connection can't be embedded into a pdf or xfo after all. I was hoping we didn't need to edit the xfo code manually, but be able to make use of the data connection. Using macro's I was able to change the tags of the iso provided xml data in to <text> tags and paste them into the xfo code.

Thanks again.