Data Source Definition File Overview

Appendix B: Data Parser

 

 

<SearchText>Football</SearchText>

<NewText>Baseball</NewText>

</ParsingRule>

The following parsing rule sets the value of the City container to "New York,

NY".

<ParsingRule Type="SetValue" Result="City"> <Value>New York, NY</Value> </ParsingRule>

The following parsing rule replaces all occurrences of "Vanilla" with "Chocolate" in the original text of the data feed. Note how the special "Source" container is being overwritten by this parsing rule - after running this rule, the special "Source" container will no longer contain the word "Vanilla".

<ParsingRule Type="Replace" Source="Source" Result="Source"> <SearchText>Vanilla</SearchText> <NewText>Chocolate</NewText>

</ParsingRule>

The following parsing rule uses a taggable parameter to replace all occurrences of the two lines

Fred Flintstone

Barney Rubble

with the single word "Dino".

<ParsingRule Type="Replace" Source="Source" Result="Source"> <SearchText>Fred Flintstone<crlf>BarneyRubble</SearchText> <NewText>Dino</NewText>

</ParsingRule>

The following parsing rule uses a taggable parameter to replace all occurrences of "Somebody" with the contents of the container called PersonName.

<ParsingRule Type="Replace" Source="Source" Result="Source"> <SearchText>Somebody</SearchText> <NewText>PersonName</NewText>

</ParsingRule>

The DataItem Element

<DataItem> elements are used to repeatedly apply a list of parsing rules. This allows Data Parser to fill a table with multiple rows of data. For example, the headlines from a news feed could be inserted, one per row, in a table.

The <DataItem> element has two optional attributes:

Polycom, Inc.

175

Page 185
Image 185
Polycom PDS 2000 manual DataItem Element, With the single word Dino