BEA came up with it, but it's also a finalized JSR, and so (I think) will wind up in a future release of java. Here are some links:

BEA's page: http://dev2dev.bea.com/technologies/stax/index.jsp
The JSR: http://jcp.org/en/jsr/detail?id=173
An article: http://www.xml.com/pub/a/2003/09/17/stax.html

I wrote an e-commerce webapp a while back that keeps all of the inventory items as objects in memory (loaded from an XML config file with XStream). On each page request, the necessary object data is assembled into dom4j objects and then pretty-printed into the output stream.

I'm happy with it, but I'm told that it'll never scale because the DOM is too memory intensive. So, I'm figuring on rewriting it at some point to use StAX. (Though I might do some research on the DOM memory consumption stuff first... if the Dom4j objects are just created to service a request and then printed to the output stream and gc'ed, it's not like they'll live that long... )

Why do you want to stream out anyway? Why not just build the Dom4J document and 
then print it?

Good Luck

Ben





David Thielen wrote:
What/where is stax?

Thanks - dave

Ps - I figure it's always better to ask and get things right :)



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Ben Munat
Sent: Thursday, December 23, 2004 10:09 AM
To: dom4j-user@lists.sourceforge.net
Subject: Re: [dom4j-user] Asking again: Write xml using SAX & dom4j

Hi David,

You might take a look at StAX... I was reading somewhere that it streams in
both directions. Makes a lot of sense too, as the thing people have always dinged
DOM implementations for is memory consumption. Although... wouldn't one need to
have the data in RAM in some form or another? I suppose this would avoid having to keep
all your data in your domain objects *and* a DOM tree.


Ben

PS: I've been on this list for almost a year and haven't ever seen as much
activity as I have the last couple weeks... it's great, keep it up!




David Thielen wrote:

Correct. Or use something to serially write xml instead of building up a

DOM

in memory and then writing the entire DOM at once.

Thanks - dave


-----Original Message-----
From: Edwin Dankert [mailto:[EMAIL PROTECTED] Sent: Thursday, December 23, 2004 3:07 AM
To: David Thielen
Cc: dom4j-user@lists.sourceforge.net
Subject: Re: [dom4j-user] Asking again: Write xml using SAX & dom4j


I'm sorry but I don't think I understand the question, what do you
mean by 'serially' and why would you like to use SAX to write xml?

Regards,
Edwin

On Wed, 22 Dec 2004 19:42:22 -0700, David Thielen <[EMAIL PROTECTED]>
wrote:




Hi;



Is there a way to write out an xml file serially?



Thanks - dave






-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user





-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to