0

Generate XML via XSLT-template

  • updated 3 yrs ago

Description

The Generate XML Via XSLT-template part can be used to create an XML document using a translation template that specifies how to format the document and which data objects to output in a specific way.

Use

The part can be added to a process node via the elements tab, misc menu option. You can use the required template to the resources\documents folder of the same LogicNets project. A basic template example, file format is XML:

<report>
  <meta>
    <reportMeta>
      <reportId>$(reportKey)</reportId>
    </reportMeta>
  <patientMeta>
    <patientId>$(patientId)</patientId>
    <patientName>$(patientName)</patientName>
    <patientGender>$(patientGender)</patientGender>
    <patientBirthdate>$(patientBirthdate)</patientBirthdate>
  </patientMeta>
  </meta>
  <xsl:include-template group="templates.example"/>
</report>


Interpolation is used for obtaining the actual values to be inserted into the specified places.

All XML nodes starting with xsl: are interpreted as commands to allow reuse of output template definitions and to specify how data objects must be printed. The select attribute specifies the name of the object (no interpolation).

The following commands are interpreted:

xsl:import-session
Import the current session data and write it as base64 encoded content.

xsl:import
Write the content of a container object instead of a text object.

xsl:plain-text-string
Simple text write. HTML content of the string is stripped.

xsl:for-each-k-v
Write the data object as key/value pairs.

xsl:for-each-k-v-simple
Write the values of a data object.

xsl:for-each-k-v-in-collection
Write the values of a collection data object.

xsl:collection-to-string
Write the collection data object as a concatenated string. Specify the separator as attribute, for example: separator="|">.

xsl:for-each
Write simply the values of a collection data object .

xsl:xsl-escape-html
Write the text data object with enforced HTML escaping. This can be used to prevent broken XML if there are illegal characters in the text.

xsl:xsl-base64
Write the data object as base64 encoded string.

xsl:if
Make the internal nodes conditional. For example: test="'$(settings.ExportText)' ~='no'"> ... 
The ctx attribute can be used to specify the context to extract the variables for the test attribute. Use base for the root object specified in the Data Source parameter.

xsl:template
Defines a reusable template.

xsl:include-template
Specify that a configured template should be printed. For example: group="templates.example"/>

Editor Fields

Field Name

Description/Use

Type/Options 

Optional/Mandatory 

Data Object

This is the name of the data object in which the messages will be stored.

Data Object

Mandatory

Filename of XSLT-template

This is the name of the translation file.

Document Reference

Mandatory

Data source

This is the data object containing the content used by the template. If you do not specify this item the system uses the running context of the logicnet.

Data Object

Options

Example

Download and import the following example project in your workspace.

Reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
Like Follow
  • 3 yrs agoLast active
  • 17Views
  • 2 Following

Home