HP NonStop Data Transformation Engine XML Data Adapter Reference Guide Abstract This manual provides information about using the HP NonStop™ Data Transformation Engine (NonStop DTE) XML Data Adapter. Product Version NonStop Data Transformation Engine 6.7.
Document History Part Number Product Version Published 528268-001 NonStop Data Transformation Engine 6.7.1 June 2004 528268-002 NonStop Data Transformation Engine 6.7.
Contents About This Document Related References........................................................................................... 4 New and Changed Information ............................................................................. 4 Chapter 1 - XML Data Adapter Overview ....................................................................................................... 5 System Requirements ........................................................................................
About This Document This document contains detailed information about using the XML Data Adapter. For general information regarding using any of the Mercator Resource adapters, see the Resource Adapters Reference Guide. This document assumes that the reader knows the Windows environment, has used the Mercator Design Studio, and understands words such as mapping, type trees, and other basic Mercator terminology.
Chapter 1 - XML Data Adapter This chapter introduces the Extensible Markup Language (XML) Data adapter. Use the adapter with a Command Server, Event Server, Platform API, or map in a map rule. Overview The XML Data adapter processes and converts XML data for use in maps. When used as a source adapter, the XML Data adapter runs an internal map to produce usable data. When used as a target adapter, the XML Data adapter produces XML formatted data.
Chapter 2 - Command Alias Specify adapter commands by using a command string on the command line or by creating a command file that contains adapter commands. The command syntax is: -IA[alias]card_num -OA[alias]card_num In the command syntax, -IA is the Input Source Override execution command and -OA is the Output Target Override execution command, alias is the adapter alias, and card_num is the number of the map card. The XML Data adapter alias and corresponding execution commands are listed below.
Chapter 3 - XML Data Adapter Commands This chapter describes the functions and use of the XML Data commands and their options. List of Commands The following table lists valid commands for the XML Data adapter, the command syntax, and whether the command is supported (√) for use with data sources, targets, or both.
Chapter 4 - Syntax Summary The following is the syntax of the XML Data adapter commands used for data sources and targets: FTP://[user[:password]@][host[:port]][/dir[/file]] HTTP://[user[:password]@][host[:port]][/dir[/file]] FILE://[dir[/file]] See URL Syntax and URL Encoding for more information.
Chapter 5 – Using the Adapter Use the XML Data adapter to process and convert XML data for use in maps. Adapter Scenarios When using the XML Data adapter, the -URL adapter command is specified using the same methods as other adapter commands.
Chapter 5 – Using the Adapter URL Syntax Examples From the GET > Source setting in an Input Card dialog, select XML Data. In the GET > Source > Command field, enter: FTP://user.pass@host/c:/forms/form7.xml This command specifies that the form7.xml file will be retrieved. The URL can be in the forms FTP, HTTP, or FILE. To override the adapter command defined in input card 1, the command string for the XML Data adapter is: -IAXMLDATA1 ‘FILE://admin.host/c:/forms/form6.
Chapter 5 – Using the Adapter URL Encoding The url_path of an FTP URL has the following syntax: cwd1/cwd2/.../cwdN/name;type=typecode where cwd1 through cwdN and name are (possibly encoded) strings and typecode is one of the characters a, i, or d. The cwdx and name parts may be empty. You may omit ;type=typecode. The whole url_path may be omitted, including the /, delimiting it from the prefix containing user, password, host, and port.
Chapter 5 – Using the Adapter URL Encoding Tokens Replaced with & (ampersand) Escape not needed, use as is # (pound) Escape not needed, use as is 8-bit or control characters Escape not needed, use as is XML Data Adapter Reference Guide 12
Chapter 6 - XML DTD Importer This chapter is an overview and general discussion of the Importer Wizard and XML DTD Importer. Overview Use the XML DTD Importer to automatically generate type trees that describe the format of XML data. The XML DTD Importer is accessible through the Importer Wizard. The Importer Wizard is an applet that is run from the Type Designer by selecting Import from the Tree menu. In pre 6.
Chapter 6 - XML DTD Importer Overview Running the XML DTD Importer: There are two different versions of DTD importers that can be accessed using the XML DTD Importer option: ♦ The 6.7 importer. To run this importer, go to Generating 6.7 Type Trees . ♦ The Pre 6.7 (Deprecated) importer. To run this importer go to Generating Pre 6.7 (Deprecated) Type Trees. Note A pre 6.
Chapter 6 - XML DTD Importer 4 Overview Select the 6.7 button. Note: Pre 6.7 (Deprecated) importer is available for legacy purposes, since the type tree structure is similar to DTD Imported type trees from previous RVUs. It is recommended that you use the 6.7 importer. The type trees generated with 6.7 importer are similar in structure to the type trees generated from XML Schemas, making the mapping process similar between DTDs and Schemas. 5 Click Next.
Chapter 6 - XML DTD Importer Overview 6 Enter the URI of the document that you want to import, or click to navigate to the the file you want to select. 7 Click Next. (browse) The Importer Wizard – XML DTD dialog box displays a national language field. Note: This procedure assumes that you are using the Non-International version of the product, in which case you do not have any options available in this dialog box. The national language field will display Western, but it will be grayed out.
Chapter 6 - XML DTD Importer 8 Overview Click Next. The Importer Wizard – XML DTD dialog box opens with the type tree File Name field displayed.
Chapter 6 - XML DTD Importer 9 Overview Enter the file name of the type tree that you want to create, or click (browse) to navigate to a file. 10 Click Next. The Mercator Type Designer message box appears if errors are detected in the type tree. 11 Click Yes to view the errors. The Importer Wizard – XML DTD dialog box appears listing the errors and warnings. 12 Click Finish. The Mercator Type Designer message box appears giving you the option to open the generated type tree.
Chapter 6 - XML DTD Importer Overview DTD Example The following example shows the correlation between the contents of a typical DTD file and the type tree that is automatically generated by the DTD Importer wizard.
Chapter 6 - XML DTD Importer Overview The DTD Importer generates the following type tree from the schema. Generating Pre 6.7 (Deprecated) Type Trees This importer is based on a Mercator map that maps the DTD document information to the type tree.
Chapter 6 - XML DTD Importer Overview This example uses the podata.dtd file installed in Mercator version \examples\xml directory. To run the Pre 6.7 (Depricated) XML DTD Importer 1 Open the Type Designer application. 2 Select Import a type tree in the Startup window and click Next. If the Type Designer is already open, select Tree > Import. The Importer Wizard dialog box appears. 3 Select XML DTD from the list and click Next.
Chapter 6 - XML DTD Importer 6 Overview Select an XML Type from the XML drop-down list. Your choices are: Generic and OAG. Note This example will select Generic. 7 In the Empty Tag group box, enable All Elements or element Declared Empty. Note This example will select All Elements. All Elements is the only (default) option to create the type trees in the legacy format. The Elements Declared Empty has been phased out in this RVU and will not generate type tree. 8 Click Next.
Chapter 6 - XML DTD Importer 9 Overview Enter the name of the type tree you are creating in the File Name field. If you use the (browse) button and select a type tree that exists, that tree will be overwritten. 10 Click Next. The Mercator Type Designer message box appears if errors are detected in the type tree. 11 Click Yes to view errors, otherwise click Finish. The Mercator Type Designer message box appears giving you the option to open the generated type tree.
Chapter 6 - XML DTD Importer Overview 12 Click Yes to view the type tree. The type tree, shown as follows, will display in the Type Designer.
Chapter 6 - XML DTD Importer Tips for Using the XML DTD Importer (pre 6.7) Tips for Using the XML DTD Importer (pre 6.7) The XML DTD Importer uses a particular process for identifying the name of the root element for the document based on several factors. The following describes this process: ♦ The importer checks to see if there is an element in the DTD that corresponds to the name of the DTD file itself. ! If one exists, it is used as the root.
Chapter 6 - XML DTD Importer Error and Warning Messages (pre 6.7) The root component will be temporarily named: UnableToIdentifyRootElement_NeedToChangeManually Element. To eliminate this analysis error and use this type tree, you must delete this component and drag-and-drop the correct root element type under Element XML into its place. See the Type Tree Importers Reference Guide for a list of errors that can occur during type tree analysis.
Appendix A - Return Codes and Error Messages Return codes and messages are returned when the particular activity completes. Return codes and messages may also be recorded as specified in the audit logs, trace files, and execution summary files. Messages The following is a listing of all the codes and messages that can be returned as a result of using the XML Data adapter for sources or targets. Note Adapter return codes with positive numbers are warning codes that indicate a successful operation.
Index . R .