The ABCs of XML, Part 4

This article provides more of what you need to know to survive in the world of connected data by identifying a few common problems you are likely to encounter transforming XML into other formats.

By John T. Sever

Share Print Related RSS
Page 3 of 3 1 | 2 | 3 Next » View on one page

Practical Examples

Example 1Example 1: Import DeltaV Modules into MS Access Database
This example fills out the transform that I created for Part 3 of this series. (Control, January 2007). (This XML file is large and may require a bit of time to unzip and view).


Example 1Example 2: Convert RSBatch Recipe to a Word Document
This example transforms a Rockwell RSBatch recipe XML file into an MS Word 2003 document. MS Word 2003 supports an XML structure (schema) that includes every feature available from inside Word 2003. A variety of information regarding XML in MS Office 2003 is available.

In case it has not yet sunk in, you can create a Word document with a text editor and some well-formed XML – without installing MS Word! Our transform simply converts the Rockwell RSBatch XML structure into a Word 2003 structure that can be edited inside MS Word 2003.

RELATED ARTICLES

The ABCs of XML: Part I
The ABCs of XML, Part 2
The ABCs of XML, Part 3

Transformation Results
DV Modules and Parameters
DV Sample

Most of our engineers can use XSLT effectively, but learning WordProcessingML is much more difficult. To bridge the gap, we have created our own simplified intermediate XML language called CascadeDocML.

To support CascadeDocML, we created an XSLT transform that converts from our simplified syntax to full WordProcessingML syntax. Therefore, to generate a Word document is a two-step process: Input XML to CascadeDocML to WordProcessingML.

This is the methodology used for this example. The download for this example includes a document describing the functionality and structure of CascadeDocML, so you may use it for your own applications. (This XML file is large and may require a bit of time to unzip and view).


Example 1Example 3: Search and Replace
This example will generate an output file that is an exact copy of the input XML file with keywords replaced according to a list of search/replace pairs defined in a separate file. This transform may be used to duplicate a complete unit configuration where only the tags have changed. This transform is different than performing search/replace in a text editor such as Notepad, as it does not replace everything throughout the file. Our sample input file is a DeltaV XML file in which we want to be very selective about what code elements are available for search/replace.

Although this example may not work perfectly for your specific application, it is extremely modular and easy to extend to your own needs. (This XML file is large and may require a bit of time to unzip and view).


Example 1Example 4: Generate Parameter Spreadsheet from RSBatch Area Model
This example will create an Excel spreadsheet of an RSBatch Area Model with each process cell, unit and phase. Each phase will include a detailed list of the phase parameters and reports. One transform in the example creates a CSV text file that may be opened in Excel. The other creates an Excel XML file instead of a CSV file. The Excel XML output includes spreadsheet formatting that is much more complete than a simple CSV file. (This XML file is large and may require a bit of time to unzip and view).


  About the Author

John T. Sever, president of Cascade Controls, can be reached at johnsever@cascon.com.
 

Page 3 of 3 1 | 2 | 3 Next » View on one page
Share Print Reprints Permissions

What are your comments?

You cannot post comments until you have logged in. Login Here.

Comments

No one has commented on this page yet.

RSS feed for comments on this page | RSS feed for all comments