OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Newbie question: XML design for configuration file

Hi all!
I'm a newbie to XML (and java, tho I have more java experience & training).  Currently we have an app that needs extensive & complex configuration.  It seems logical to put the configuration into several xml docs.  There is no one inhouse with xml experience but the experienced java programmer seems to think I should "Super" generalize the xml doc.

The configurations will ultimately endup in a HashMap containing a string key & a value that can be either a string, hashtable, arrayList, etc.  He thinks I should basically do something like this:


<section name="global">
	<conf key="logDir">/var/logs</conf>
	<conf key="notify">eon@kp.org</conf>
<section name="server">
	<conf key="RunAsDaemon">0</conf>
	<conf key="username">eon</conf>
<section name="Fields" type="hashtable">
	<conf key="fullName">A1</conf>
	<conf key="SSN">A5</conf>
	<conf key="Dept">HR</conf>
<section name="Auth" type="ArrayList">
	<conf key="SSN"/>
	<conf key="employeeNumber"/>
	<conf key="fullName"/>
something like that. The DTD would be fairly easy to write & a Schema could be written to set up data restrictions. 

However, in the Java & XML book & the tutorials I've taken, it seems to me, that this might be too general of an XML design (it does parse as a well formed XML document). So I'm confused as to how to design the documentation.  It's primary use if for a Java Class but we could add some HTML tags & then have a java class turn it into HTML documentation (wow 2 uses for one doc!).

Should I instead make if more specific?? with something like:
<myXML:section name="global">
<myXML:section name="server">
<myXML:section name="Fields" type="hashtable">
<section name="Auth" type="ArrayList">

It does seem like the more general is more java like & the more specific seems more HTML like.  I'm confused!

thanks in advance.