XSLT Large xml files

Discussion in 'XML' started by Rajesh Patel, Jun 28, 2004.

  1. Rajesh Patel

    Rajesh Patel Guest

    I am currently using JDOM to access a rather large xml document(2mb).
    JDOM is taking up too much memory, I am looking for somethng that
    is more light weight.

    I know that SAX will work, but I would rather uses something like
    xslt since I'm tranforming the xml document into HTML. Don't
    ask me why they want to transform such a large document into HTML,
    especially considering the resultant HTML is going to be over 20meg.
    That is what the customer wants...

    So, is XSLT suitable for this type of thing, or is it going to
    end up loading up the entire document into memory?

    Raj
    Rajesh Patel, Jun 28, 2004
    #1
    1. Advertising

  2. Rajesh Patel wrote:

    > I am currently using JDOM to access a rather large xml document(2mb).
    > JDOM is taking up too much memory, I am looking for somethng that
    > is more light weight.
    >
    > I know that SAX will work, but I would rather uses something like
    > xslt since I'm tranforming the xml document into HTML. Don't
    > ask me why they want to transform such a large document into HTML,
    > especially considering the resultant HTML is going to be over 20meg.
    > That is what the customer wants...
    >
    > So, is XSLT suitable for this type of thing, or is it going to
    > end up loading up the entire document into memory?


    XSLT builds a tree of the document so yes, it loads the entire document
    into memory however depending on the implementation it might not use a
    usual DOM tree but something lighter.

    --

    Martin Honnen
    http://JavaScript.FAQTs.com/
    Martin Honnen, Jun 28, 2004
    #2
    1. Advertising

  3. Rajesh Patel (Mon, 28 Jun 2004 18:00:19 GMT):
    > I am currently using JDOM to access a rather large xml document(2mb).
    > JDOM is taking up too much memory, I am looking for somethng that
    > is more light weight.


    I use libxml2 (wrapped in pyhton) with a slightly larger document
    (120 MB ;-)

    It takes 400 MB memory.

    > So, is XSLT suitable for this type of thing, or is it going to
    > end up loading up the entire document into memory?


    XLSTing a 3 MB sized document into an other 3 MB sized document can be
    done with libxsl (of the libxml2-project) within practically no time (2
    or 3 seconds) and 30 MB of RAM.

    A good approximation is: 4x(size inpzt + size output) bytes memory.


    Chris
    --
    Chris Huebsch www.hübsch-gemacht.de | TU Chemmnitz, Informatik, RNVS
    GPG-Encrypted mail welcome! ID:7F2B4DBA | Str. d. Nationen 62, B204
    Chemnitzer Linux-Tage 2005, 5.-6.März | D-09107 Chemnitz
    http://www.tu-chemnitz.de/linux/tag/ | +49 371 531-1377, Fax -1803
    Chris Huebsch, Jun 29, 2004
    #3
  4. Rajesh Patel

    GIMME Guest

    Off hand the problem probably isn't JDOM ...

    The problem is that the JDOM solution that you envision reads a
    20 MB file and then attempts to transform the thing in one shot.

    You need to read the file element by element and then transform
    element by element.
    GIMME, Jun 30, 2004
    #4
    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. Stylus Studio
    Replies:
    0
    Views:
    654
    Stylus Studio
    Aug 3, 2004
  2. Replies:
    1
    Views:
    2,917
    Gregory Vaughan
    Apr 8, 2005
  3. Replies:
    4
    Views:
    668
  4. Lenny Wintfeld
    Replies:
    0
    Views:
    735
    Lenny Wintfeld
    May 17, 2006
  5. jkflens
    Replies:
    2
    Views:
    1,466
    jkflens
    May 30, 2006
Loading...

Share This Page