SXI Forum

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

You are not logged in.

#1 26-11-2021 08:17:02

ZwidoG
Member
From: Pretoria
Registered: 21-11-2018
Posts: 4
Website

Concatenation Rule on XLayer version 3

Refer to the example Concatenation rule below:

The Rule can be applied to a new field in which case you would have  <Input newField="yes"/>
In the example you can see a static value is set simply by putting in the static value i.e.    <Field>this is static</Field>
In the example below you can set the contents of an element addressed by an xPath statement simply by inserting the xPath as shown below i.e.  <Field>//default:FileNameZwido</Field>


<RuleDefinition name="ConcatForZwido">
      <Fields>
        <Field id="3">
          <Input newField="yes"/>
          <Rules>
            <Concatenation>
              <Delimiter> </Delimiter>
              <Fields>
                <Field>//default:mServer</Field>
                <Field>reported by:</Field>
                <Field>//default:mFName</Field>
                <Field>-</Field>
                <Field>//default:mLName</Field>
              </Fields>
            </Concatenation>
          </Rules>
          <OutputElement>short_description</OutputElement>
        </Field>
      </Fields>
</RuleDefinition>

In the example below you can set the contents of a variable simply by specifying the variable name i.e.  <Field>~#~LocalVariable1~#~</Field>
The Rule can be applied to an existing element as in this example where you have  <Input newField="no">//default:FileNameZwido</Input>


<RuleDefinition name="ConcatForZwido">
      <Fields>
        <Field id="FID1">
          <Input newField="no">//default:FileNameZwido</Input>
          <Rules>
            <Concatenation>
              <Delimiter>-</Delimiter>
              <Fields>
                <Field>this is static</Field>
                <Field>~#~LocalVariable1~#~</Field>
                <Field>//default:FileNameZwido</Field>
              </Fields>
            </Concatenation>
          </Rules>
          <OutputElement>ZwidosConcatTest</OutputElement>
        </Field>
      </Fields>
    </RuleDefinition>

Last edited by ZwidoG (26-11-2021 14:18:34)

Offline

Board footer

Powered by FluxBB