Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
Bedrock Mission!

Learn more

View all

Sign in to view all badges

Binding XML file Dynamically

hkho
Level 3
Level 3

Can I bind a xml file dynamically to a form? say, bind to a different xml file after user select a value from a drop down list in the form?

how to do it? Thanks.
10 Replies
Anonymous
Not applicable

LiveCycle uses the XML as a sourcefile for generating the content, it is provided before generation meaning I seriously doubt your goal is achievable, yet I'm no expert in LiveCycle myself...

Steve_L_Walker
Level 10
Level 10

Is the intention to re-populate the existing PDF form with a different XML instance?

hkho
Level 3
Level 3

thanks for the reply.

what i trying to do it is to implement a form with multi language.

so, when a user select a language from a drop down list then labels and captions bind to a correct xml file.

or please advise the best way to implement a form with multi language.

thanks.

Anonymous
Not applicable

I think it's best to create different XPD files for each language and add an XML tag <language>countryCode</language> to your XML dataset and XSD file. this way you could tell the workbench to use a different xpd file for generating the PDF file.

Anyway if you want to load an XML file from your local filesystem you should check out this URL: http://www.c-point.com/JavaScript/articles/file_access_with_JavaScript.htm it shows you how to read & write files using javascript.

The problem you'll be facing is editing the binding and reading + validating the given XML file. Especially validating the XML vs the XSD file used in the designer will probably cause a few errors, yet this is highly recommended in order to make sure you're not modifying your PDF with the wrong (or even malicious) data.

Security-wise i would not implement it your way but make a different XPD file for each language. In the LiveCycle Workbench you can select the correct XPD file based on the data you provide. Then it's just the user who needs to specify his/her language and your pdf is always build correctly. Yet I do not know if this is applicable to your situation and/or needs.

Steve_L_Walker
Level 10
Level 10

I have attached a PDF that display captions based upon data binding. The PDF has two buttons - French and English. Based upon the selection you can import either 'captionFrench.xml' or 'captionEnglish.xml'.

If the attachments get queued, and they probably will, please send an email to stwalker.adobe@gmail.com and request the attachments.

Steve

hkho
Level 3
Level 3

thanks MaFdOn, can you show me how to select a different xpd file from workbench?

is it possible to select the xpd file base on user's locale? how to do that?

thanks

Anonymous
Not applicable

I'm really busy today, but you can make 2 workbench processes and each bind them to a different xpd file. It wouldn't surprise me if you could make it select a different depending on the xml data provided, but I have no time to verify at this very moment, I might later on the day.

Good luck

hkho
Level 3
Level 3

so, is there any way to get the locale in workbench and base on the information to choose the right process?

Steve_L_Walker
Level 10
Level 10

Are you asking if a process could determine the locale of the Reader/Acrobat client and render a PDF for that locale?

hkho
Level 3
Level 3

yes, but i am more interested in the livecycle workspace. when a user open a form from the workspace, can the process get the locale and display the form with the right language?