How to generate an XML schema for an existing form

Until recently, when I’ve been using LiveCycle ES to learn about developing processes I often found myself creating a form using Designer ES and manually creating an XML schema to embed in it. I want to embed the schema so that I can see the data model of the form in Workbench ES. Seeing the data model is useful when you are creating XPath expressions using XPath Builder to access a value from the form data.

My limited knowledge of XML schema enables me to create only the simplest of schemas, and consequently, the simplest of forms. However, I’ve now learned how to generate an XML schema for an existing form. This frees me from having to learn the intricacies of XML schema, and enables me to use more complex forms in my processes:

1. Create the form in Designer ES. If you are creating an XDP file, save it as a different file in PDF format.
2. Open the form in Acrobat Professional.
3. Save the form data to an XML file.
4. Use the file with a tool that derives XML schemas from XML documents.
5. Embed the schema in the form. (see Displaying the form data model in XPath Builder in LiveCycle Workbench ES Help.)

Here is a blog article that lists a few free tools that derive schemas from XML: http://blog.dotkam.com/2008/05/28/generate-xsd-from-xml/. I like using Trang, a command-line tool written in Java (you need to have a Java runtime environment (JRE) installed to run it). The blog also lists some GUI-based tools if you prefer those.

Further Considerations

You may be tempted to use the XML schema that you generate as the schema for a database to use to store form data. This would work, however this solution doesn’t scale well. If you develop several LiveCycle ES applications you will likely use many different forms to gather different sets of data. In this case, you should use a common schema for all forms.

It’s also important to realize that the process doesn’t need the XML schema to execute correctly. XPath expressions that locate form field data items are evaluated correctly regardless of whether the schema is present. You also don’t need to see the data model of the form in XPath builder to create XPath expressions. Seeing the data model makes it much easier.

VN:F [1.9.22_1171]
Was this helpful? Please rate the content.
Rating: 3.7/10 (3 votes cast)
How to generate an XML schema for an existing form, 3.7 out of 10 based on 3 ratings

Comments are closed.