6. Prerequisites
Prev |  | Next

## 6. Prerequisites

xmlformat has very few prerequisites. It requires no extra modules other than an option-processing module. In particular:

- xmlformat requires no XML processing modules. XML parsing is done with a single (rather complex) regular expression developed by Robert D. Cameron. A paper that discusses development of this parsing expression is available; see Section 7, “ References ”.

- xmlformat requires no text-processing modules such as Text::Wrap. I tested Text::Wrap to see if it was suitable for xmlformat. It was not, for the following reasons:

  - If Text::Wrap encounters an individual word that is longer than the line length, older versions of Text::Wrap invoke die(). In newer versions, you can have long words left intact.

  - Text::Wrap converts runs of spaces in the leading indent to tabs. (Though this can be suppressed.)

  - Text::Wrap reformats inline tags (and may change attribute values). xmlformat preserves tags intact.

  In addition, the simple algorithm used by xmlformat appears to be about twice as fast as Text::Wrap (at least on Mac OS X).

Prev |  | Next
5. How xmlformat Works | Home | 7. References