Unstructured XML


This function is only available for "classic" templates. You can find more information here.

CAUTION
Unstructured XML can only be used with the primedocs Client. Server-side processing via the Document Creation Server is not possible.

The specialist application provides the following XML:

<root> <company> <name>Contoso Ltd.</name> <division>Sales</division> </company> <changedate>2019-01-01</changedate> </root>

From this we would like to further use the content of name and place it in the template. To do this, the next step is to transform this unstructured XML into Connect format. In this example we will create full Connect XML (not Type Data).


1. Create Connect interface definition

<CustomInterfaces> <InterfaceDescription Name="ContosoInterface" Description="Interface Contoso"> <Node Id="ContosoInterface.CompanyName">[CompanyName placeholder]</Node> <Node Id="ContosoInterface.CompanyDivision">[CompanyDivision placeholder]</Node> </InterfaceDescription> </CustomInterfaces>

2. Create XML transformation

Now we need to transform the unstructured XML into a form that fits the interface definition from the previous step. We need the following result from the transformation:

<OneOffixxConnectBatch xmlns="http://schema.oneoffixx.com/OneOffixxConnectBatch/1" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> <Settings /> <Entries> <OneOffixxConnect> <Arguments> <TemplateId>804ea87d-37a4-4307-99d7-23d16032f426</TemplateId> <LanguageLcid>2055</LanguageLcid> </Arguments> <Function name="CustomInterfaceConnector" id="70E94788-CE84-4460-9698-5663878A295B"> <Arguments> <Interface Name="ContosoInterface"> <Node Id="ContosoInterface.CompanyName">Contoso Ltd.</Node> <Node Id="ContosoInterface.CompanyDivision">Sales</Node> </Interface> </Arguments> </Function> </OneOffixxConnect> </Entries> </OneOffixxConnectBatch>

For this purpose, a new interface is created in the XML Transformer. In this interface, the connect frame is specified and the relevant data is extracted and transformed using XSLT and XPath.

 

PrimeSoft AG, Bahnhofstrasse 4, 8360 Eschlikon, Switzerland