Generating Template Files
Generating Template Files
The first step in any XML mapping is to upload template files representing the source and destination XML structure. These samples can be generated within Arc in several ways.
Template Files from Transformation Connectors
Transformation connectors like X12, EDIFACT, and CSV automatically convert documents into XML. In addition, EDI connectors make the full file schema available to the XML Map connector. This provides an easy starting point for mapping your EDI file into the desired format, especially in cases where a single test file might not cover all the elements that could be required in the mapping.
Upload Test File
Follow these steps to generate an XML representation of an input file:
- In the Input tab of a transformation connector, click the More dropdown and click Upload Test File.
- Navigate to a file on disk that you want to model as XML, select it, and click OK.
- Connect an EDI connector to an XML Map connector in the flow. This connection can go in either direction—inbound to the XML Map connector, or outbound from the XML Map connector.
- Save the changes to your flow to confirm the structure of the connectors.
The XML Map connector automatically detects the structure of the test file. Based on where you placed the EDI connector, the file appears in the Source File or Destination File drop-down menu of the XML Map connector.
- Test files are only available in the XML Map connector if a compatible connector is linked to XML Map in the flow.
- If you upload a test file to a connector and it does not appear in the linked XML Map connector, save the changes to your flow and check the XML Map connector again.
Manually Create a Test File
You can also manually create test files. Simply send a sample file through the transformation connector (EDI connectors should be explicitly configured as ‘EDI-to-XML’ mode) to generate an XML output file. Download that output file and upload it again as the source or destination file in an XML Map connector.
Template Files from Database Connectors
Database connectors like the SQL Server, MySQL, and CData connectors automatically generate XML representations of their Input and Output mappings. Similar to EDI and CSV connectors, after an source or destination mapping is saved in a database connector, any connected XML Map connectors can automatically detect these XML structures.
To use a database table structure as a source or destination file, follow these steps:
- In the database connector, establish a working connection to the database.
- Choose an action (for example, Select, or Upsert), and configure it accordingly. Optionally, you can use the Preview button to save a sample for mapping that includes sample data.
- Connect an XML Map connector to the database connector in the flow.
- Find the table structure as a source or destination file in the XML Map connector settings.
XML Map connectors are typically between two other connectors in an Arc flow. It is usually best to generate template files with the two connectors surrounding an XML Map connector in the flow. For example, the following flow has an XML Map connector mapping X12 files to a database insert:
In this example, the X12 connector and the SQL Server connector should be used to generate the XML template files for the XMLMap connector between them. See Template Files from Transformation Connectors and Template Files from Database Connectors for details on generating a template file from an X12 or SQL Server connector.