3.15

@@GetInCollection

Use @@GetInCollection when you want extract a specific item from a set of nodes.

Syntax:

@@GetInCollection(<source>, <test>, <selection>)

Parameters:

<source>

The nodes to check in the xml, specified as #dataset.node. All matching nodes are considered the collection.

<test>

A test condition that evaluates to true or false. You can include tokens in the test. If the token is in the collection, do not include the source node. If the token is outside the collection, include the entire token address. See the examples at the end of this section.

When testing on a string (non-numeric value), enclose the data in single quotes. When testing on a number, do not use single quotes.

Use Or and And for testing multiple conditions. Or evaluates to true when any of the conditions are true. And evaluates to true only when all of the conditions are true.

You can use any of the following test conditions.

=

equals

<>

does not equal

<

less than (only allowed with numeric data)

>

greater than (only allowed with numeric data)

<selection>

Element to place in the document when the test condition is true. Can be a token. If a token, it must be in the collection. Do not include the source node in the token address. The doc processor places the first token in the collection where the test is true.

 

Example

XML:

<Terms>

      <SpIsCoverage>Y</SpIsCoverage>

      <AgIsCoverage>N</AgIsCoverage>

</Terms>

<Benefits>
      <Benefit>
        <BenefitCode>Dental</BenefitCode>
        <IsProposalExclude>N</IsProposalExclude>
        <Limit>(Dental) Included in AME Maximum</Limit>
        <Other>
            <NestedProperty1>Y</NestedProperty1>
            <NestedProperty2>0</NestedProperty2>
        </Other>
      </Benefit>
      <Benefit>
        <BenefitCode>Physiotherapy</BenefitCode>
        <IsProposalExclude>Y</IsProposalExclude>
        <Limit>(Physiotherapy) Included in AME Maximum</Limit>
        <Other>
            <NestedProperty1>N</NestedProperty1>
            <NestedProperty2>500</NestedProperty2>
        </Other>
      </Benefit>
      <Benefit>
        <BenefitCode>CATCash</BenefitCode>
        <IsProposalExclude>N</IsProposalExclude>
        <Limit>(CATCash) Included in AME Maximum</Limit>
        <Other>
            <NestedProperty1>N</NestedProperty1>
            <NestedProperty2>100000</NestedProperty2>
        </Other>
      </Benefit>
    </Benefits>

Code:

@@GetInCollection(#Benefits.Benefit, #BenefitCode = ‘CATCash’ AND #IsProposalExclude = ‘N’, #Other.NestedProperty2)

Output:

100000

Code:

@@GetInCollection(#Benefits.Benefit, #Terms.SpIsCoverage = 'Y', #Other.NestedProperty2)

Output:

0