[xml] using xmlTextReader efficiently



I'd like to use xmlTextReader to parse and validate source documents against DTDs and Relax NG. I'm somewhat familiar with this already, as I've used libxml2 before.

It just dawned on me, however, that it would be a good idea to ask the list to confirm some assumptions I've made about using xmlTextReader. I've looked at the source, but I'm not the most experienced C programmer, so I wanted to double check with the experts.

Basically, I want to verify that you can use xmlTextReader like an ideal SAX parser that doesn't build an entire tree structure of source documents in memory.

I assume that this example:


does not build an in-memory tree of the entire source doc being validated, but rather only holds small portions of the document at a time. Is that correct?

Additionally, when taking similar action with a RELAX NG schema, does the same hold true for the source document (obviously, the schema doc has to be parsed into a tree in memory)?

Thanks for the advice!



Todd Ditchendorf

Scandalous Software - Cocoa Developer Tools





[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]