10.2 Transforming XML 243
Descriptor: Antineoplastic Agents, Hormonal
Descriptor: Antineoplastic Combined Chemotherapy Protocols
Descriptor: Breast Neoplasms
Descriptor: Chemotherapy, Adjuvant
Descriptor: Estrogen Antagonists
Descriptor: Female
Descriptor: Hematopoietic Stem Cell Transplantation
Descriptor: Human
Descriptor: Lymphatic Metastasis
Descriptor: Neoplasm Staging
Descriptor: Piperidines
Descriptor: Raloxifene
Descriptor: Randomized Controlled Trials
Descriptor: Risk Factors
Descriptor: Tamoxifen
The handlers style of processing XML documents is the most efficient way
to process XML. In fact, all other styles are based on the handlers style. How-
ever, the handlers style is difficult to use when one needs to do more compli-
cated processing of the document. Subsection 10.2.3 presents another style
that is better suited to more complex tasks.
Summary
- One way to process XML documents is to parse the document one element
at a time. This is called the handlers style. - In the handlers style, one specifies procedures that are invoked by the
parser. Most commonly one specifies procedures to be invoked at the
start of each element, for the text content of the element, and at the end of
the element. - A common way to design procedures is for the parameters to be in pairs:
a parameter name and a parameter value. To make this easier to read, one
should separate the parameter name from the parameter value with the
=>symbol. - The handlers style for parsing XML documents is efficient and fast but is
only appropriate when the processing to be done is relatively simple.