Data Source Tutorial Appendix B: Data Parser
Polycom, Inc. 183
width="11%"><b>Tonight<br></b><br><img
src="/images/wtf/ntsra80.jpg" width="55" height="58" alt="Heavy
Rain Chance for Measurable Precipitation 80%" title="Heavy Rain
Chance for Measurable Precipitation 80%"
><br>Heavy<br>Rain<br>Lo <font
color="#0033CC">69°F</font></td><td
width="11%"><b>Friday<br></b><br><img
src="/images/wtf/hi_tsra20.jpg" width="55" height="58"
alt="Slight Chance Thunderstorms Chance for Measurable
Precipitation 20%" title="Slight Chance Thunderstorms Chance for
Measurable Precipitation 20%" ><br>Slight Chc<br>Tstms<br>Hi
<font color="#FF0000">85°F</font></td><td
width="11%"><b>Friday<br>Night</b><br><img
src="/images/wtf/hi_ntsra20.jpg" width="55" height="58"
alt="Slight Chance Thunderstorms Chance for Measurable
Precipitation 20%" title="Slight Chance Thunderstorms Chance for
Measurable Precipitation 20%" ><br>Slight Chc<br>Tstms<br>Lo
<font color="#0033CC">67°F</font></td><td
width="11%"><b>Saturday<br></b><br><img
src="/images/wtf/few.jpg" width="55" height="58" alt="Mostly
Sunny" title="Mostly Sunny" ><br>Mostly<br>Sunny<br>Hi <font
color="#FF0000">86°F</font></td><td
width="11%"><b>Saturday<br>Night</b><br><img
src="/images/wtf/nfew.jpg" width="55" height="58" alt="Mostly
Clear" title="Mostly Clear" ><br>Mostly<br>Clear<br>Lo <font
color="#0033CC">69°F</font></td><td
width="11%"><b>Sunday<br></b><br><img src="/images/wtf/few.jpg"
width="55" height="58" alt="Mostly Sunny" title="Mostly Sunny"
><br>Mostly<br>Sunny<br>Hi <font
color="#FF0000">92°F</font></td><td
width="11%"><b>Sunday<br>Night</b><br><img
src="/images/wtf/nsct.jpg" width="55" height="58" alt="Partly
Cloudy" title="Partly Cloudy" ><br>Partly<br>Cloudy<br>Lo <font
color="#0033CC">75°F</font></td><td
width="11%"><b>Monday<br></b><br><img src="/images/wtf/sct.jpg"
width="55" height="58" alt="Partly Cloudy" title="Partly Cloudy"
><br>Partly<br>Cloudy<br>Hi <font
color="#FF0000">91°F</font></td></tr>
This is a single HTML table row that contains all the weather data we need.
Before we extract that data, we use the ReplaceCharacterCodes rule to replace
all HTML character codes (e.g. °) with their true characters (e.g. the
degree symbol °):
<ParsingRule type="ReplaceCharacterCodes" source="Source"
result="Source" />
Now that the text characters are in order, we want to set about extracting each
day part's forecast. We use a DataItem element to apply a set of parsing rules
9 times, once for each day part in the HTML code:
<DataItem NumRecords="9" ClearTableOnStart="True">
…
</DataItem>