split2D method: Utility class

Syntax

split2D()

Description

Use this method to extract the elements from the string that are enclosed in the specified tag. Child elements enclosed by the child tags are also extracted. All elements are XML decoded.

Parameters

Parameter Description

String

Specifies the string to check.

Tag

Specifies the tag that encloses each string element, as a string. This tag can be an empty string.

ChildTags

Specifies the tags that enclose each child element, as an array of string.

Returns

An array of array of string containing the extracted string elements enclosed by the specified tags. Child elements are enclosed by the child tags. All elements are XML decoded.

Example

import PTFP_FEED:UTILITY:Utility;

Local PTFP_FEED:UTILITY:Utility &utility = create PTFP_FEED:UTILITY:Utility();

&str = "<div><b>value1</b><i>value2</i></div>";

&arr = &utility.split2D(&str, "div", CreateArray("b", "i"));

/* &arr[1][1]="value1", &arr[1][2]="value2" */