scalable xml

Discussion in 'Python' started by hyperboreean, May 21, 2008.

  1. hyperboreean

    hyperboreean Guest

    Hi, I am writing the application server for a three-tier architecture
    and sending the client's response in xml. My question is: is there a way
    to build the xml dom in a more scalable way and faster way than just
    creating every textNode and element for it? I have tons of data to
    transmit and it drives me crazy having to build that dom manually.

    I am not sure if this is a stupid question as I don't know other
    alternatives ... maybe just provide a template xml which I can fill with
    data but that can introduce some pretty ugly bugs in the application.


    Thanks.
     
    hyperboreean, May 21, 2008
    #1
    1. Advertising

  2. hyperboreean wrote:

    > Hi, I am writing the application server for a three-tier architecture
    > and sending the client's response in xml. My question is: is there a way
    > to build the xml dom in a more scalable way and faster way than just
    > creating every textNode and element for it? I have tons of data to
    > transmit and it drives me crazy having to build that dom manually.
    >
    > I am not sure if this is a stupid question as I don't know other
    > alternatives ... maybe just provide a template xml which I can fill with
    > data but that can introduce some pretty ugly bugs in the application.


    You should have a look at the ElementTree-package (which also comes
    api-compatible as lxml). These allow for a much more pythonic way of
    creating XML-trees.

    However you might consider using a much more concise format such as json for
    transport (if you have control over the client). It reduces the data-amount
    to about a tenth or so (of course depending on your xml-dialect), with
    considerable gains in processing time.

    And then there in fact are some template languages such as KID and genshi
    that might suit you because they enforce proper XML.

    Diez
     
    Diez B. Roggisch, May 21, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. John Grandy

    scalable state-management

    John Grandy, Mar 17, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    343
    Scott Allen
    Mar 18, 2005
  2. =?Utf-8?B?QnJlbnQgQm9yb3Zhbg==?=

    Scalable web architecture with ASP.NET 2.0

    =?Utf-8?B?QnJlbnQgQm9yb3Zhbg==?=, Dec 11, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    609
    =?Utf-8?B?QnJlbnQgQm9yb3Zhbg==?=
    Dec 12, 2005
  3. =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=

    Scalable Application Design

    =?Utf-8?B?VGVycnkgSG9sbGFuZA==?=, Mar 17, 2006, in forum: ASP .Net
    Replies:
    3
    Views:
    1,580
    Laurent Bugnion
    Mar 18, 2006
  4. Ilya
    Replies:
    9
    Views:
    1,819
  5. Curtis
    Replies:
    13
    Views:
    661
    Curtis
    Dec 21, 2005
Loading...

Share This Page