[jdom-interest] RE: Whitespace

Jeremy Whitlock jwhitlock at starprecision.com
Tue Jan 20 07:17:57 PST 2004


Bradley,
	Basically, I've got this document that every time it's loaded,
all <connection> nodes will be deleted and then rebuilt with the most
current information from an ArrayList so take into account that I'm
reading in a document, modifying it and then saving it again.  (In
production, this will be the case but for now, I'm not even modifying)
Thanks, Jeremy

-----Original Message-----
From: jdom-interest-admin at jdom.org [mailto:jdom-interest-admin at jdom.org]
On Behalf Of Bradley S. Huffman
Sent: Monday, January 19, 2004 9:20 PM
To: jwhitlock at starprecision.com
Cc: jdom-interest at jdom.org
Subject: Re: [jdom-interest] RE: Whitespace 

"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
_______________________________________________
To control your jdom-interest membership:
http://lists.denveronline.net/mailman/options/jdom-interest/youraddr@you
rhost.com




More information about the jdom-interest mailing list