most complete xml package for Python?

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

    #1

    most complete xml package for Python?

    Without even checking them all out, I'm thinking the Amara XML Toolkit
    must be the most feature-packed. The developers are readily available
    on IRC for support and they seem to make regular releases.

    As a meld3 user, I have been using ElementTree under the hood, but was
    dismayed to find out that you can't find elements by attribute and I
    am finding it difficult to remove elements.

    So I am out shopping for a new friend to grok XML.

    Input welcome.

  • Gerard Flanagan

    #2
    Re: most complete xml package for Python?

    On Mar 13, 1:43 pm, "metaperl" <metap...@gmail .comwrote:
    Without even checking them all out, I'm thinking the Amara XML Toolkit
    must be the most feature-packed. The developers are readily available
    on IRC for support and they seem to make regular releases.
    >
    As a meld3 user, I have been using ElementTree under the hood, but was
    dismayed to find out that you can't find elements by attribute and I
    am finding it difficult to remove elements.
    Hardly in competition with Amara or lxml, but I wrote this extension
    to ElementTree which handles attributes to a limited extent:



    (Be aware that parts of the filter string are 'eval-ed')

    Gerard


    Comment

    • Stefan Behnel

      #3
      Re: most complete xml package for Python?

      metaperl wrote:
      Without even checking them all out, I'm thinking the Amara XML Toolkit
      must be the most feature-packed.
      Please check out lxml before you post FUD like this.



      Regards,
      Stefan

      Comment

      • Paul Boddie

        #4
        Re: most complete xml package for Python?

        On 14 Mar, 16:15, Stefan Behnel <stefan.behne l-n05...@web.dewr ote:
        metaperl wrote:
        Without even checking them all out, I'm thinking the Amara XML Toolkit
        must be the most feature-packed.
        >
        Please check out lxml before you post FUD like this.
        >
        http://codespeak.net/lxml/
        Calm down, Stefan! The inquirer must have got the impression of
        Amara's superiority from somewhere; all you need to do is to discover
        which resource gave that impression and balance the situation out. In
        any case, it's an opinion: there's no fear involved, and the only
        uncertainty and doubt are in the inquirer's mind, which I suppose is
        why they posted the inquiry.

        Paul

        Comment

        • Steve Holden

          #5
          Re: most complete xml package for Python?

          Paul Boddie wrote:
          On 14 Mar, 16:15, Stefan Behnel <stefan.behne l-n05...@web.dewr ote:
          >metaperl wrote:
          >>Without even checking them all out, I'm thinking the Amara XML Toolkit
          >>must be the most feature-packed.
          >Please check out lxml before you post FUD like this.
          >>
          >http://codespeak.net/lxml/
          >
          Calm down, Stefan! The inquirer must have got the impression of
          Amara's superiority from somewhere; all you need to do is to discover
          which resource gave that impression and balance the situation out. In
          any case, it's an opinion: there's no fear involved, and the only
          uncertainty and doubt are in the inquirer's mind, which I suppose is
          why they posted the inquiry.
          >
          Although the phrase "without even checking them all out" hardly lends
          credence to the OP's assertion of Amara's superiority, and does tend to
          support a hypothesis involving some ulterior motive (or would if less
          ingenuously done).

          regards
          Steve
          --
          Steve Holden +44 150 684 7255 +1 800 494 3119
          Holden Web LLC/Ltd http://www.holdenweb.com
          Skype: holdenweb http://del.icio.us/steve.holden
          Blog of Note: http://holdenweb.blogspot.com
          See you at PyCon? http://us.pycon.org/TX2007

          Comment

          • John Machin

            #6
            Re: most complete xml package for Python?

            On Mar 15, 3:45 am, Steve Holden <s...@holdenweb .comwrote:
            Paul Boddie wrote:
            On 14 Mar, 16:15, Stefan Behnel <stefan.behne l-n05...@web.dewr ote:
            metaperl wrote:
            >Without even checking them all out, I'm thinking the Amara XML Toolkit
            >must be the most feature-packed.
            Please check out lxml before you post FUD like this.
            >>
            Calm down, Stefan! The inquirer must have got the impression of
            Amara's superiority from somewhere; all you need to do is to discover
            which resource gave that impression and balance the situation out. In
            any case, it's an opinion: there's no fear involved, and the only
            uncertainty and doubt are in the inquirer's mind, which I suppose is
            why they posted the inquiry.
            >
            Although the phrase "without even checking them all out" hardly lends
            credence to the OP's assertion of Amara's superiority, and does tend to
            support a hypothesis involving some ulterior motive (or would if less
            ingenuously done).
            >
            Given keywords like "Amara" and "Elementtre e" and past history, it
            looked to me like a troll of one kind trying to incite a troll of
            another kind to pop out from under the bridge and chew on his
            ankle :-)


            Comment

            • metaperl

              #7
              Re: most complete xml package for Python?

              On Mar 14, 5:34 pm, "John Machin" <sjmac...@lexic on.netwrote:

              >
              Given keywords like "Amara" and "Elementtre e" and past history, it
              looked to me like a troll of one kind trying to incite a troll of
              another kind to pop out from under the bridge and chew on his
              ankle :-)
              Well, I'm not a troll. And I am now even less impressed with
              ElementTree. It does not preserve the document but reforms it in
              certain cases.

              <script></script>

              gets rewritten as

              <script />

              which leads to problems when embedding Dojo Rich Text Editors.


              Comment

              • Marc 'BlackJack' Rintsch

                #8
                Re: most complete xml package for Python?

                In <1173909884.822 838.264030@n76g 2000hsh.googleg roups.com>, metaperl
                wrote:
                Well, I'm not a troll. And I am now even less impressed with
                ElementTree. It does not preserve the document but reforms it in
                certain cases.
                >
                <script></script>
                >
                gets rewritten as
                >
                <script />
                >
                which leads to problems when embedding Dojo Rich Text Editors.
                So those editors have some problem with XML. I'm not impressed
                by such code. ;-)

                It's like complaining about:

                In [100]: '\x61'
                Out[100]: 'a'

                It's the same information, just a different representation. Both are
                within the specs.

                Ciao,
                Marc 'BlackJack' Rintsch

                Comment

                • John Machin

                  #9
                  Re: most complete xml package for Python?

                  On Mar 15, 9:04 am, "metaperl" <metap...@gmail .comwrote:
                  On Mar 14, 5:34 pm, "John Machin" <sjmac...@lexic on.netwrote:
                  >
                  Given keywords like "Amara" and "Elementtre e" and past history, it
                  looked to me like a troll of one kind trying to incite a troll of
                  another kind to pop out from under the bridge and chew on his
                  ankle :-)
                  >
                  Well, I'm not a troll. And I am now even less impressed with
                  ElementTree. It does not preserve the document but reforms it in
                  certain cases.
                  >
                  <script></script>
                  >
                  gets rewritten as
                  >
                  <script />
                  >
                  which leads to problems when embedding Dojo Rich Text Editors.
                  As BlackJack has pointed out, that's syntactically equivalent. If that
                  bothers you, best you don't check out what it does with namespace
                  prefixes.

                  Comment

                  • Paul Boddie

                    #10
                    Re: most complete xml package for Python?

                    On 14 Mar, 17:45, Steve Holden <s...@holdenweb .comwrote:
                    >
                    Although the phrase "without even checking them all out" hardly lends
                    credence to the OP's assertion of Amara's superiority, and does tend to
                    support a hypothesis involving some ulterior motive (or would if less
                    ingenuously done).
                    It's an opinion being expressed, qualified with evidence to show that
                    it's weakly substantiated. Hardly a reason to "call FUD" or to suspect
                    an astroturfing campaign - FUD being one of the most readily used
                    terms (and consequently one of the most overused or inappropriately
                    used terms) when people disagree in the technology domain, anyway.

                    If the inquirer has it wrong, a gentle process of education is
                    necessary, although it should be noted that the process does involve
                    listening to their account of what they are trying to achieve rather
                    than telling them that they are stupid for using a particular tool or
                    other.

                    Paul

                    Comment

                    • Diez B. Roggisch

                      #11
                      Re: most complete xml package for Python?

                      metaperl schrieb:
                      On Mar 14, 5:34 pm, "John Machin" <sjmac...@lexic on.netwrote:
                      >
                      >
                      >Given keywords like "Amara" and "Elementtre e" and past history, it
                      >looked to me like a troll of one kind trying to incite a troll of
                      >another kind to pop out from under the bridge and chew on his
                      >ankle :-)
                      >
                      Well, I'm not a troll. And I am now even less impressed with
                      ElementTree. It does not preserve the document but reforms it in
                      certain cases.
                      >
                      <script></script>
                      >
                      gets rewritten as
                      >
                      <script />
                      >
                      which leads to problems when embedding Dojo Rich Text Editors.
                      Beside the fact that this is a problem of browsers (which won't help you
                      much, as you have to deal with this somehow, blaming browsers alone
                      isn't solving problems I'm just too aware of), I wonder: which XML
                      framework _does_ preserve such tags?

                      I can't imagine a way of doing so as a DOM node is a DOM node. I could
                      only create a custom renderer for HTML to circumvene that specific
                      pitfall - but then, you could also create a post-rendering filter
                      regex-based that expands the script-tags

                      Diez

                      Comment

                      • Paul Boddie

                        #12
                        Re: most complete xml package for Python?

                        Diez B. Roggisch wrote:
                        metaperl schrieb:

                        Well, I'm not a troll. And I am now even less impressed with
                        ElementTree. It does not preserve the document but reforms it in
                        certain cases.

                        <script></script>

                        gets rewritten as

                        <script />

                        which leads to problems when embedding Dojo Rich Text Editors.
                        >
                        Beside the fact that this is a problem of browsers (which won't help you
                        much, as you have to deal with this somehow, blaming browsers alone
                        isn't solving problems I'm just too aware of), I wonder: which XML
                        framework _does_ preserve such tags?
                        I can't remember exactly how I solved this within an XML/XSLT-heavy
                        Java-based framework, mostly to satisfy Internet Explorer if I
                        remember correctly, but it does lead to some fairly inelegant hacks.
                        Something like this might work:

                        <script><![CDATA[]]></script>

                        I note that such things are mentioned here (the first search result
                        for "CDATA" when I tried):

                        Sorry! We can't seem to find the resource you're looking for


                        Paul

                        P.S. I'm off to fix CDATA support in libxml2dom, but I'm sure lxml
                        supports CDATA. Not sure about Amara, though. ;-)

                        Comment

                        • metaperl.etc@gmail.com

                          #13
                          Re: most complete xml package for Python?

                          On Mar 15, 5:45 pm, "Paul Boddie" <p...@boddie.or g.ukwrote:

                          >
                          I can't remember exactly how I solved this within anXML/XSLT-heavy
                          Java-based framework,
                          I just put a single space between:

                          <script</script>

                          and then it kept the XML container-style as opposed to single-tag.

                          Comment

                          Working...