It is also worth noting that you can usually do SAX-style parsing in
most XML parsing libraries that are normally associated with DOM style
parsing and conveniences like XPath selectors. For example, Nokogiri
does SAX and it is *very* fast:
http://nokogiri.org/Nokogiri/XML/SAX/Document.html
As a related question, when folks do SAX-style parsing and need to
select highly conditional and deeply nested elements (think getting
MODS title data only when a parent element's attribute matches a
condition and it is all nested in a big METS wrapper), how are you
keeping track of those nesting and conditional rules? I have relied on
using a few booleans that get set and unset to track state, but it
often feels sloppy.
-steve
On Fri, Jun 8, 2012 at 2:41 PM, Ethan Gruber <[log in to unmask]> wrote:
> but I have gotten noticeably better
> performance from Saxon/XSLT2 than PHP with DOMDocument or SimpleXML or
> nokogiri and hpricot in Ruby.
|