Results 1 to 3 of 3
  1. #1
    sathishscjp is offline Member
    Join Date
    Jul 2009
    Posts
    3
    Rep Power
    0

    Default Xml File generation - xstream

    i need to build the xml file from database resultset


    - <chart caption="Country Comparison" shownames="1" showvalues="0" decimals="0" numberPrefix="$">
    - <categories>
    <category label="Austria" />
    <category label="Brazil" />
    <category label="France" />
    <category label="Germany" />
    <category label="USA" />
    </categories>
    - <dataset seriesName="1996" color="AFD8F8" showValues="0">
    <set value="25601.34" />
    <set value="20148.82" />
    <set value="17372.76" />
    <set value="35407.15" />
    <set value="38105.68" />
    </dataset>
    - <dataset seriesName="1997" color="F6BD0F" showValues="0">
    <set value="57401.85" />
    <set value="41941.19" />
    <set value="45263.37" />
    <set value="117320.16" />
    <set value="114845.27" />
    </dataset>
    - <dataset seriesName="1998" color="8BBA00" showValues="0">
    <set value="45000.65" />
    <set value="44835.76" />
    <set value="18722.18" />
    <set value="77557.31" />
    <set value="92633.68" />
    </dataset>
    </chart>

    i thought of using xstream is there any other good tools or api availble comparingly with xstream?

  2. #2
    fredemc is offline Member
    Join Date
    Jul 2009
    Posts
    1
    Rep Power
    0

    Default Tried W3C DOM?

    You can create an xml file and write it out using the w3cDOM package. It has methods to insert child nodes and such. Also, an xml file is ultimately just a text file, so if you can handle maintaining the structure yourself, it can just be done w/ a string writer.

  3. #3
    vkorenev is offline Member
    Join Date
    Aug 2009
    Location
    Kharkov, Ukraine
    Posts
    29
    Rep Power
    0

    Default

    DOM is very memory consuming when dealing with lot of data. It is better to use StAX in this case or simple println-s.

Similar Threads

  1. War file generation
    By vislawath.jawaharlal in forum Threads and Synchronization
    Replies: 0
    Last Post: 04-07-2009, 02:12 PM
  2. Storing and Retrieveing Data Using XStream & xml Files
    By geeeeky.girl in forum New To Java
    Replies: 0
    Last Post: 01-04-2009, 11:24 PM
  3. EJB generation with xdoclet tags
    By gugas in forum Enterprise JavaBeans (EJB)
    Replies: 0
    Last Post: 02-18-2008, 02:07 PM
  4. random generation
    By carlos123 in forum New To Java
    Replies: 10
    Last Post: 01-09-2008, 04:43 AM
  5. String generation
    By codingisfun22 in forum Advanced Java
    Replies: 3
    Last Post: 12-03-2007, 06:43 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •