Skip to main content

Create XML Output (Template and Node Settings) - Knowledgebase / Lasernet / Lasernet Training / Lasernet Form Editor 9 - XHTML, CSV, EDI, XML, JSON, PDF Form (filled) Output - Formpipe Support Portal

Create XML Output (Template and Node Settings)

Authors list

Using the Lasernet Form Editor application, you can produce files of the XML format. The Form Engine retrieves data from an input grab file, processes it and maps it to fields in the output.

In this exercise, you are proposed to create a structure of the output in the XML format.

Exercise

Download and import the attached configuration called 05. Create XML Output (Template and Node Settings) in Lasernet Developer 9. Afterwards, go to the Forms section and open the Sample form.

Lasernet supports loading pre-defined XML templates. So, if you have an XML template file received, for example, from a customer or a business partner, you can import it to your Lasernet project and, thereby, achieve significant time savings on the design phase.

1. Start by opening a template based on which you can create the required structure of your XML output. First, make sure you are on the XML tab in the output, and then, on the toolbar, click Open Template.

2. In the Open Template dialog displayed, select the template, and then click Open.

3. In the Import XML Template dialog displayed, leave the Enable default values check box cleared, and select the xml check box in the Output sheet section. Once you are done, click Finish.

4. In the output, switch to the Template tab.

5. On the Template tab, you can directly edit a plain text representation of the XML output file. To this end, scroll down the output to the bottom and insert the following nodes after the <cac:Delivery> one:

<cac:InvoiceLine>

    <cbc:InvoicedQuantity unitCode="EA">9.99</cbc:InvoicedQuantity>

    <cbc:LineExtensionAmount currencyID="DKK">9.99</cbc:LineExtensionAmount>

    <cac:Item>

      <cbc:Name>NAME</cbc:Name>

    </cac:Item>

    <cac:Price>

      <cbc:PriceAmount currencyID="DKK">9.99</cbc:PriceAmount>

    </cac:Price>

  </cac:InvoiceLine>

Tip: You can always click the Pretty-Print button to adjust the spacing and formating in the preview. The XML structure will afterwards contain the same standard formatting convention for all lines.

6. Switch to the XML tab.

7. Right-click the <Invoice> node, and then click Expand All in the context menu that appears.

8. Scroll down the output to reach the <cac:InvoiceLine> node. You are now proposed to change properties for each node of those ones you have added to disable their default values, if any. To this end, right-click a node and then select Properties in the context menu that appears.

9. In the Node Template Properties dialog box displayed, clear the Use default value if no rearrange data is provided check box.

Make this change for every node you have added.

10. You are now proposed to add one more child node to <cac:InvoiceLine>. To this end, right-click the <cac:InvoiceLine> node, and then select Add Child Node in the context menu that appears.

11. In the Node Template Properties dialog box displayed, specify the following values:


  • Type cbc:ID as a node name.
  • Clear the Use default value if no rearrange data is provided check box.


Once you are done, click the Ok button.

12. You can change the order of child nodes which belong to the <cac:InvoiceLine> one. To this end, right-click a child node, and then click Move Up or Move Down depending on the direction you want to move a node.

As a result, you have the following structure of the <cac:InvoiceLine> node:



Helpful Unhelpful

Add a comment

Please log in or register to submit a comment.

Need a password reminder?

Share