Home arrow Perl Programming arrow Using Perl with XML (part 1)

Using Perl with XML (part 1)

Converted your little black book into XML, and don't know what to do next? This article gets you started on the path to being an XML guru, demonstrating how to use Perl's SAX parser to parse and convert your XML into Web-friendly HTML.

TABLE OF CONTENTS:
  1. Using Perl with XML (part 1)
  2. Getting Down To Business
  3. Let's Talk About SAX
  4. Breaking It Down
  5. Call Me Back
  6. Random Walk
  7. What's For Dinner?
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 20
January 15, 2002

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Unless you've spent the last couple of years under a rock, you know about XML, the Extensible Markup Language, and its extended family of related technologies - XSLT, XPath, XLink, WDDX et al. You may even have used it a couple of times, creating XML documents to describe your address book or your CD collection, and marveled at how simple the process is.

It's at this point that most novice developers hit a brick wall. Sure, they know the theory of creating an XML document, and they may even understand why the technology is so widely discussed and praised. But when it comes to actually doing something with it - converting that XML-encoded CD collection into something that can be read by a browser, for example - there's simply not enough information out there to provide guidance on how to take the next step.

Over the next few pages, I will be attempting to rectify this a little bit, with an explanation of how you can convert your XML data into browser-readable HTML. Since XML is nothing but plain text, it makes sense to use a language which specializes in parsing text documents...which is where Perl, that granddaddy of text processing languages, comes in. There are a couple of basic approaches to parsing XML data; this two-part article will explore the Perl implementation of each, together with examples and illustrations.

I'll try and keep it simple - I'm going to use very simple XML sources, so you don't have to worry about namespaces, DTDs and PIs - although I will assume that you know the basic rules of XML markup, and of Perl scripting. So let's get this show on the road.

 
 
>>> More Perl Programming Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

PERL PROGRAMMING ARTICLES

- Perl Turns 25
- Lists and Arguments in Perl
- Variables and Arguments in Perl
- Understanding Scope and Packages in Perl
- Arguments and Return Values in Perl
- Invoking Perl Subroutines and Functions
- Subroutines and Functions in Perl
- Perl Basics: Writing and Debugging Programs
- Structure and Statements in Perl
- First Steps in Perl
- Completing Regular Expression Basics
- Modifiers, Boundaries, and Regular Expressio...
- Quantifiers and Other Regular Expression Bas...
- Parsing and Regular Expression Basics
- Hash Functions

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: