Business Integration Solutions Documentation

About: XMLMinifier Activity

In Business Integration Solutions, use the XML Minifier activity to clean an xml document of empty nodes/blocks that are not mandatory.

Setup the XML Minifier

XMLMinifierSetup

Field Description
Document Type Specifies if the linked document will be external or internal
Document No. Specifies the linked document

Examples

  1. The below example uses a simple internal document, based on the SalesPerson/Purchaser table. It contains two mandatory fields "GlobalDimension1Code" and "NextTaskDate".

Document1Setup

We will use the following connection to get some test data for the XML Minifier.

TimerEvent > XMLGenerator > Mapper

Timer Event: we use it to export a set of records from BC

XML Generator: we use it to map the set of records to a readable XML structure

Mapper: we use it to create a desired mapped document that will be processed by the XML Minifier. For this example, we used the same document as the source and the target and simply kept the mapping 1:1

The resulted XML document that will be send to the XML Minifier has the following structure. Notice that the mandatory node "GlobalDimension1Code" is empty, and non-mandatory nodes "GlobalDimension2Code" and "PhoneNo" are empty as well.

<?xml version="1.0" encoding="utf-8"?>
<document>
  <SalespersonPurchaser>
    <Code>HR</Code>
    <Name>Helena Ray</Name>
    <Commission>0</Commission>
    <PrivacyBlocked>false</PrivacyBlocked>
    <GlobalDimension1Code></GlobalDimension1Code>
    <GlobalDimension2Code></GlobalDimension2Code>
    <EMail>HR@contoso.com</EMail>
    <PhoneNo></PhoneNo>
    <NextTaskDate>2024-01-20</NextTaskDate>
    <NoofOpportunities>11</NoofOpportunities>
  </SalespersonPurchaser>
</document>

The XML document resulted from the XML Minifier has the following structure. Notice that the empty mandatory node "GlobalDimension1Code" has been kept into the structure, while the non-mandatory nodes "GlobalDimension2Code" and "PhoneNo" have been removed.

<SalespersonPurchaser>
    <Code>HR</Code>
    <Name>Helena Ray</Name>
    <Commission>0</Commission>
    <PrivacyBlocked>false</PrivacyBlocked>
    <GlobalDimension1Code></GlobalDimension1Code>
    <EMail>HR@contoso.com</EMail>
    <NextTaskDate>2024-01-20</NextTaskDate>
    <NoofOpportunities>11</NoofOpportunities>
  </SalespersonPurchaser>
  1. The below example uses a multi level internal document based on the SalesHeader, SalesLine and Item table. In the below example the following nodes are mandatory: "SalesHeader/YourReference" and "Item".

Document2Setup

We are going to use the same connection setup as in the first example, but replace the document used with the structure above and have no node mapped within the "Item" block. The resulted document resulted from the mapper will have the following structure.

<?xml version="1.0" encoding="utf-16"?>
<document xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:st="urn:Streamer" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:ti="http://www.to-increase.com/data/document">
  <SalesHeader>
    <SelltoCustomerNo>30000</SelltoCustomerNo>
    <No>101005</No>
    <YourReference></YourReference>
    <SalesLine>
      <LineNo>10000</LineNo>
      <Type>2</Type>
      <No>1920-S</No>
      <Description>ANTWERP Conference Table</Description>
      <JobNo></JobNo>
      <Item>
        <No></No>
        <Description></Description>
        <UnitCost></UnitCost>
        <StandardCost></StandardCost>
      </Item>
    </SalesLine>
  </SalesHeader>
</document>

The XML document resulted from the XML Minifier has the following structure. Notice that the empty mandatory nodes "SalesHeader/YourReference" and "Item" have been kept into the structure, while the non-mandatory nodes "JobNo" and the nodes within the "Item" have been removed.

<document xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:st="urn:Streamer" xmlns:dt="urn:schemas-microsoft-com:datatypes" xmlns:ti="http://www.to-increase.com/data/document">
  <SalesHeader>
    <SelltoCustomerNo>30000</SelltoCustomerNo>
    <No>101005</No>
    <YourReference />
    <SalesLine>
      <LineNo>10000</LineNo>
      <Type>2</Type>
      <No>1920-S</No>
      <Description>ANTWERP Conference Table</Description>
      <Item/>
    </SalesLine>
  </SalesHeader>
</document>