Generating XML Documents

Where do XML documents come from? It’s kind of like the famous question: Which came first, the chicken or the egg? You can’t parse an XML document until you build one. The source data for an XML document can come from just about any imaginable source. For example, an XML document can be generated from a CSV file, a tab-delimited text file, the results of a database query, a Common Gateway Interface (CGI) web-based user input form that collects data from a user, Web services, and many, many other sources. You can see that there is an almost infinite number of data sources for XML documents.

Let’s take a look at two methods of generating XML documents. First, an XML document can be created in a standard text editor or ...

Get XML and Perl 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.