Home > Data > XML Output Linkage > Input Pass Thru > Write XML input data to XML output

Write XML input data to XML output

When you use a Server or Desktop XML Output Definition, you can create an XML output result file that contains both the input XML data (the XML file containing the input data; read in using an XML Database Linkage) and the XML output results (as defined by the Output Definition and the XML Output Linkage).

In the XML Output Linkage, at the bottom of the Input Pass Thru tab (where you define the scalar or array fields that are to be sent to the XML output results), you can choose to combine the XML input data and XML output results in a single XML output file using a user specified root node (for the combined XML output file). Root names must start with a letter or underscore, but cannot start with the letters XML (or xml, or Xml, etc) or contain spaces. Root names can contain letters, digits, hyphens, underscores, and periods. ProAdmin enforces a minimum length of 4 characters.

For example, suppose the XML input data's root node (as specified in the XML Database Linkage's schema) is InputData, the XML output results' root node (as specified in the XML Output Linkage's schema) is CalcResults, and the new root node for the combined input data and XML results is CombinedXML. Then the combined XML output file would look something like this:

<?xml version="1.0"?>
...
<CombinedXML>
<InputData>
...
</InputData>
<!-- Created by ProAdmin (Winklevoss Technologies, LLC) -->
<!-- Computer/Server name: KRONE -->
<!-- Calculation date: July 29, 2019  4:13 PM -->
<CalcResults>
      ...
</CalcResults>
</CombinedXML>

Note that all the input XML (and comments, but not declarations, e.g., <?xml version="1.0"?>) will become the first child node to the new root node, and the ProAdmin generated comments for the original XML output results will appear above the second child node (e.g., CalcResults), just where they would appear if the XML input data and XML output results had not been combined.

If you are applying an XSL Transformation (XSLT) on the xml output results, you may have to tweak it to account for the fact there is a new root node and the root node of the xml output results is now a child node. This is especially so if the XSLT is using full xpaths rather than relative xpaths, or the same nodes exist in both the input xml and the output xml (and you have a template in the XSLT that works on a node that appears in both the input and output xmls).