Article:
  Using PHP 5's SimpleXML
Subject:   Neat, but...
Date:   2004-01-16 03:54:16
From:   anonymous2
I imagine the overhead of parsing the whole document and loading it into memory can be tremendous for sufficiently-large XML documents.


In spite of that, it's a very cool extension. Makes me look forward to the release of PHP 5 that much more.

Full Threads Newest First

Showing messages 1 through 2 of 2.

  • Adam Trachtenberg photo Neat, but...
    2004-01-16 09:54:22  Adam Trachtenberg | O'Reilly Author [View]

    SimpleXML uses the same parsing functions libxml2 uses to create DOM documents. Yes, you do have the overhead of needing to contain the entire document in memory; however, this is all handled in C, so the process is fast and efficient. (As compared to doing this in PHP.)

    The only alternative from a memory perspective is SAX, but SAX can be quite painful to program when your schema is complex. (Try parsing the Apple pList format, for example.)
    • Neat, but...
      2004-03-10 12:31:04  riffraff [View]

      what about pull parsing? isn't that both memory efficient and at least easyer to handle than sax ?