XML::Simple is a DOM parser.
Here's an quick explanation of the difference between SAX and DOM taken from http://www.webreference.com/xml/column11/3.html
SAX vs. DOM
The DOM is a quite convenient way to access and manipulate XML data, but it comes with a price to pay:
SAX is more useful in cases where:
I'm sure there are better explanations. There are lots of SAX parsers but they are all more complicated to program than XML::Simple. However, I think it is worth getting into if you are doing a lot of XML parsing.
Here's an quick explanation of the difference between SAX and DOM taken from http://www.webreference.com/xml/column11/3.html
Quote:
SAX vs. DOM
The DOM is a quite convenient way to access and manipulate XML data, but it comes with a price to pay:
- The underlying XML needs to be fully parsed before processing can occur. As most DOM implementations are purely memory-based, this limits the amount of XML data that can be processed this way. Also the possiblity for pipelining various stages of processing is limited.
- The DOM structure only defines generic nodes, whereas most languages are strongly typed so that one might want to map specific nodes to specific classes of say Java code.
SAX is more useful in cases where:
- Huge amounts of XML need to be processed, but the information needed is highly local, meaning only a small amount of data needs to be stored. This is usually the case in transforming linear documents, where little cross-linking occurs.
- Various stages of XML processing are interconnected to form a pipeline. The next stage can then begin its work as soon as the first character comes out of the previous one, instead of having to wait for the full document to be converted into objects.
I'm sure there are better explanations. There are lots of SAX parsers but they are all more complicated to program than XML::Simple. However, I think it is worth getting into if you are doing a lot of XML parsing.