[jdom-interest] RE: Whitespace

Bradley S. Huffman hip at cs.okstate.edu
Mon Jan 19 20:19:42 PST 2004


"Jeremy Whitlock" writes:

> Bradley,
>       That made no change.  Here it is:

Hmmm, I use this

<?xml version="1.0" encoding="UTF-8"?>
<!--DBPirate Configuration File-->
<dbpirate>
   <connections>
      <connection> 
         <name>Oracle</name>
         <user>cbuser</user>
         <password>cbpass</password>
         <hostname>localhost</hostname>
         <port>1521</port>
         <timestamp>345678</timestamp>
         <class>org.mysql.jdbc.Driver</class>
         <url>jdbc:mysql at localhost:3306:cookbook:cbuser:cbpass</url>
         <sid>cookbook</sid>  
      </connection>
      <connection> 
         <name>MySQL</name>
         <user>scott</user>
         <password>tiger</password>
         <hostname>localhost</hostname>
         <port>1521</port>
         <timestamp>12345888</timestamp>
         <class>oracle.jdbc.OracleDriver</class>
         <url>jdbc:oracle:thin at localhost:1521:orcl:scott:tiger</url>
         <sid>orcl</sid>  
      </connection>
   </connections>
</dbpirate>

with this

import org.jdom.Document;
import org.jdom.input.SAXBuilder;
import org.jdom.output.XMLOutputter;

public class TestXMLOutputter {

    public static void main(String args[]) throws Exception {
        try {
            SAXBuilder builder = new SAXBuilder();
            Document doc = builder.build("pirate.xml");
            XMLOutputter outputter = new XMLOutputter();
            outputter.output(doc, System.out);
        }
        catch (java.io.IOException e) {
            e.printStackTrace();
        }
    }
}

And it worked as expected with B9 and the latest CVS. What version of
JDOM are you using?

Brad



More information about the jdom-interest mailing list