PyXML: SAX vs. DOM

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Matthias Kaeppler

    #1

    PyXML: SAX vs. DOM

    Hi,

    I have to say I am confused about the documentation on pyxml.sf.net.
    When I want to use DOM, I effectively am using a class called Sax2? ^^
    I also have to catch SAXExceptions, which reside in xml.sax._except ions.

    I thought DOM and SAX are two completely different things. Why is PyXML
    mixing them up like this?

    Thanks,
    Matthias
  • Matthias Kaeppler

    #2
    Re: PyXML: SAX vs. DOM

    Oh and:
    Where can I find an API reference for PyXML? Am I supposed to /guess/
    which methods and attributes e.g. Sax2 supplies? :D

    Thanks again,
    Matthias

    Comment

    • Steven Bethard

      #3
      Re: PyXML: SAX vs. DOM

      Matthias Kaeppler wrote:[color=blue]
      > I have to say I am confused about the documentation on pyxml.sf.net.
      > When I want to use DOM, I effectively am using a class called Sax2? ^^
      > I also have to catch SAXExceptions, which reside in xml.sax._except ions.
      >
      > I thought DOM and SAX are two completely different things. Why is PyXML
      > mixing them up like this?[/color]

      I don't have an answer to your real question, but if you're not
      committed to a particular XML package yet, you might consider ElementTree:


      The API is much simpler, and the package has a much more sane
      organization. ;) Plus, it will be part of the Python standard library
      in Python 2.5.

      STeVe

      Comment

      • Matthias Kaeppler

        #4
        Re: PyXML: SAX vs. DOM

        Steven Bethard wrote:[color=blue]
        > I don't have an answer to your real question, but if you're not
        > committed to a particular XML package yet, you might consider ElementTree:
        > http://effbot.org/zone/element-index.htm
        >
        > The API is much simpler, and the package has a much more sane
        > organization. ;) Plus, it will be part of the Python standard library
        > in Python 2.5.[/color]

        That sounds great, thanks.

        Regards,
        Matthias

        Comment

        • Ivan Herman

          #5
          Re: PyXML: SAX vs. DOM

          -------- Original Message --------
          From: Matthias Kaeppler <void@void.co m>
          To:
          Subject: Re:PyXML: SAX vs. DOM
          Date: 20/1/2006 21:26
          [color=blue]
          > Oh and:
          > Where can I find an API reference for PyXML? Am I supposed to /guess/
          > which methods and attributes e.g. Sax2 supplies? :D
          >
          > Thanks again,
          > Matthias[/color]


          Matthias,

          your question is valid, and I just tell you how *I* do it...

          - the core of the methods in DOM are described by the W3C recommendations . I
          think the most relevant ones are:




          where you can find all objects and methods that are defined by DOM Level 2 and,
          as far as I could see, all properly implemented by PyXML.

          The only caveat is that DOM2 defines the interface in abstract (more exactly, in
          IDL), and one has to know (or guess) how those are mapped onto Python. Having
          said that, by looking at the PyXML documentation:



          mainly



          one can do a very good educated guess so it is not sooo bad as it sounds.

          I know this is not the ideal answer, but maybe it helps...

          Ivan

          Comment

          • Matthias Kaeppler

            #6
            Re: PyXML: SAX vs. DOM

            Ivan Herman wrote:[color=blue]
            > I know this is not the ideal answer, but maybe it helps...[/color]

            It does, thanks Ivan.

            Regards,
            Matthias

            Comment

            Working...