Women in Technology

Hear us Roar

  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.

Main Topics Oldest First

Showing messages 1 through 1 of 1.

  • 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.)