Results 1 to 2 of 2
  1. #1
    ravian is offline Senior Member
    Join Date
    Nov 2007
    Posts
    115
    Rep Power
    0

    Default What to use (DOM or SAX)

    I have to parse a XML file. I am new to this and don't know what to use. Please advice. Also link to some tutorial will be appreciated.

    Chao.

  2. #2
    DonCash's Avatar
    DonCash is offline Moderator
    Join Date
    Aug 2007
    Location
    London, UK
    Posts
    240
    Rep Power
    8

    Wink

    I personally like to use DOM parse.

    They both have their advantages and it all depends on exactly what you want to do.

    DOM is quite heavy on memory. This is because it reads the entire document into memory before processing. DOM has the advantage of being able to insert or delete nodes and also has the ability to traverse in any direction.

    SAX is a lot easier on memory and it parses Node by Node. The disadvantages are that you cannot insert or delete a node, and it will only traverse from top to bottom.

    A Google search will reveal all!

    ONJava.com -- Using DOM to Traverse XML

    Let me know if you need any more help and I will post a few examples for you here.
    Did this post help you? Please me! :cool:

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •