Chapter 8. Programmingfor XML

Let's face it. You can't always wait around for somebody to create the perfect software for your needs: there will come a time when you have to roll up your sleeves and build it yourself. But rather than attempting to teach you everything about writing programs for XML, the intent of this chapter is to provide an introduction to programming technologies that let you get the most out of XML. We'll keep the discussion short and general to allow you to choose the best way to go, and leave the details to other authors.

There is no "best" programming language or style to use. There are many ways to skin a potato,[1] and that applies to programming. Some people prefer to do everything in Perl, the "duct tape of the Internet," while others like to code in Java, preferring its more packaged and orderly philosophy. Even if programmers can't agree on one venue for coding, at least there is XML support for most common programming languages used today. Again, the choice of tools is up to you; this chapter focuses on theory.

[1] A vegetarian-friendly (and feline-friendly) metaphor. ;-)

We first discuss XML parsing and processing in general terms, outlining the pros and cons of using XML as a data storage medium. Then, we move on to talk about XML handling techniques and present an example of a syntax-checking application written in Perl. And finally, we introduce some off-the-shelf components you can use in your programs, and describe two emerging technologies ...

Get Learning XML now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.