Whilst the standard for most web pages is the Hyper Text Mark-up Language (HTML) a similar standard has developed for the transmission of structured data within a string. This standard is known as eXtended Mark-up Language or XML. As with HTML, information is grouped using opening and closing tags, which make the parsing of the data comparatively simple using ESL built-in “extract” statement, as the following routine demonstrates:
The problem with the above routine is that the XML standard allows for multiple occurrences of a field whilst the routine can only return one occurrence, which will be the first. Consider the following structure:
An Example of the above ESL Structure in XML might be:
To enable the parsing of multiple address lines, we need to include a starting position, enabling a loop to be set-up to extract each occurrence, as in the following code:
As the example Client structure includes an embedded Address structure, we recommend that the sub XML string is extracted before being parsed, to prevent any duplicate tag names that may occur when there are multiple embedded structures. Using the above routine the Client parse routine is: