[jdom-interest] [Q}About New Line Problem using XMLOutputter

ITOH Kazuhiro itoh at ipc.kajima.co.jp
Tue Jan 30 17:40:20 PST 2001


Dear  ALL:
This is Kazuhiro from Japan.

I am developping simple schedule system on the web with JDOM.
Abstratct of this System is as following:
step1 reading schedule.xml file.
step2 adding new information in servlet & jsp.
step3 writing new XML Structure to the File schedule.xml

At step1 schedule.xml is like this for example:
<?xml version="1.0" encoding="Shift_JIS"?>
<root>
  <to-do name="Jhon">foo</to-do>
<root>

at step3, I output XML Document using XMLOutputter(" ", true, "encoding").
After doing this, schedule.xml file is like this:

<?xml version="1.0" encoding="Shift_JIS"?>
<root>

    <to-do name="Jhon">foo</to-do>
    <to-do name="Ken">bar</to-do>
<root>

After repeating  from step1 to step3, I got XML file like this.
<?xml version="1.0" encoding="Shift_JIS"?>
<root>


    <to-do name="Jhon">foo</to-do>

    <to-do name="Ken">bar</to-do>
    <to-do name="Ben">bar</to-do>
<root>

As you know, newline is added existing elements with XMLOutputter(" ", true,
"encoding").

I need XML File as below:

<root>
    <to-do name="Jhon">foo</to-do>
    <to-do name="Ken">bar</to-do>
    <to-do name="Ben">bar</to-do>
<root>

What kind of process is needed for such a output?

      _/_/_/_/_/__/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
                       Kajima Corporation
                IT Business Development gr.(Educational Market)
                        I.T. Solutions Department
         *Phone#  :81-3-3746-7394(Ex. 23317)
         *Fax#    :81-3-3746-7134

mailto:itoh at ipc.kajima.co.jp
                                                 Kazuhiro Itoh
      _/_/_/_/_/__/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/



More information about the jdom-interest mailing list