#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2004
    Location
    Isle of dogs
    Posts
    68
    Rep Power
    10

    HTMLparser vs Sax


    I am creating a complexed html editor much like Dreamweaver. I need a good parser. Dom parsers are inflexible because they do not except malformed documentation. HTML documents are malformed while being created by the user.

    I am currently using Pythons HTMLparser to do the job, but I am worried that I cannot modify documents using it. I need to know the difference HTMLparser and Sax parsers. Does sax do everything that HTMLparser does.
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    I haven't used SAX before though if I'm not mistaken It's used for Parsing XML and you want to parse HTML don't you. Anyway I've just noticed there's an article on Devshed, which I haven't read yet about using SAX with Python so maybe that would help.

    http://www.devshed.com/c/a/Python/Parsing-XML-with-SAX-and-Python/

    Take care bell,

    Mark.
    programming language development: www.netytan.com Hula


IMN logo majestic logo threadwatch logo seochat tools logo