SXI Forum

A place to collect usefull tips, tricks and implementation strategies.

You are not logged in.

#1 15-03-2019 12:56:05

MarekR
Member
Registered: 21-02-2019
Posts: 19

Rules: Split

This rule will Split a string into separate elements inside objects in memory.

Example:

Address= “20 Peltier Dr, Sunninghill, 2191”

We want to Split the text whenever there is a , so that we can get a street , suburb and postal-code.

<sxi:Field name="//*[local-name()=’Address’]">
 <sxi:Rules>
            <sxi:Split>
              <sxi:Delimiter>,</sxi:Delimiter>
              <sxi:OutputFields>
                <sxi:OutputField index="0">Street</sxi:OutputField>
                <sxi:OutputField index="1">Suburb</sxi:OutputField>
                <sxi:OutputField index="2">PostalCode</sxi:OutputField>
              </sxi:OutputFields>
            </sxi:Split>
          </sxi:Rules>
 <sxi:OutputField>Address</sxi:OutputField>
</sxi:Field>

After using the above config this is what will be stored in memory:

<Address>20 Peltier Dr, Sunninghill, 2191</Address>
<Street>20 Peltier Dr</Street>
<Suburb>Sunninghill</Suburb>
<PostalCode>2191</PostalCode>

Attributes:

  • index:
    The split creates an array of elements separated by the delimiter. Each element of this array is identified by the index attribute.

  • number:
    If number is set to "yes" then the string is split on the number of characters you specified.

Last edited by MarekR (15-03-2019 12:58:30)

Offline

Board footer

Powered by FluxBB