By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
449,034 Members | 1,040 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 449,034 IT Pros & Developers. It's quick & easy.

how to read XML configuration parameters, bool, int, double, string

P: n/a
Hello,

I am new to java and need to write a program that uses an XML file for its
configuration. I have an equivalent C++ program that uses libxml2 from
gnome for this task. I wrapped this up in a class (libxml2 is a C
interface). I am wondering how people solve this problem in java.

Googling reveals a tonne of xml configuration projects all pulling in
different directions with different dependencies. The ones that stick out
(IMHO) are JFig, JConfig and Carbon. Can anyone make any recommendations
please?

Ideally the solution should offer the ability to specify the name of a
file that contains the XML, and provide functions to get named attributes
as boolean, integer, double or string values. These functions need to be
able to take an optional default value. Where the configuration value is
missing from the config file and no default has been specified there must
be a means of communicating this to the caller.

Regards,

Andrew Marlow
--
There is an emerald here the size of a plover's egg!
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
Mar 7 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Wed, 07 Mar 2007 16:23:05 +0100, Andrew Marlow wrote:
Hello,

I am new to java and need to write a program that uses an XML file for its
configuration. I have an equivalent C++ program that uses libxml2 from
gnome for this task. I wrapped this up in a class (libxml2 is a C
interface). I am wondering how people solve this problem in java.
For anyone who's interested, I found out how to do this: use JDOM.

--
There is an emerald here the size of a plover's egg!
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
Mar 23 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.