[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Newbie question: XML design for configuration file

  • From: Erin O'Neill <Eon@k...>
  • To: xml-dev <xml-dev@l...>
  • Date: Mon, 23 Jul 2001 10:54:02 -0700

java configuration file xml
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@k...</conf>
</section>
<section name="server">
	<conf key="RunAsDaemon">0</conf>
	<conf key="username">eon</conf>
</section>
<section name="Fields" type="hashtable">
	<conf key="fullName">A1</conf>
	<conf key="SSN">A5</conf>
	<conf key="Dept">HR</conf>
</section>
<section name="Auth" type="ArrayList">
	<conf key="SSN"/>
	<conf key="employeeNumber"/>
	<conf key="fullName"/>
</section>
...
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:notify>eon@k...</myXML:notify>
	<myXML:logDir>/var/logs</myXML:logDir>
</myXML:section>
<myXML:section name="server">
	<myXML:RunAsDaemon>0</myXML:RunAsDeamon>
	<myXML:username>eon</myXML:username>
</myXML:section>
<myXML:section name="Fields" type="hashtable">
	<myXML:fullName>A1</myXML:fullName>
	<myXML:SSN>A5</myXML:SSN>
	<myXML:Dept>HR</myXML:Dept>
</section>
<section name="Auth" type="ArrayList">
	<myXML:SSN/>
	<myXML:employeeNumber/>
	<myXML:fullName/>
</section>
...

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

thanks in advance.
erin

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
 

Stylus Studio has published XML-DEV in RSS and ATOM formats, enabling users to easily subcribe to the list from their preferred news reader application.


Stylus Studio Sponsored Links are added links designed to provide related and additional information to the visitors of this website. they were not included by the author in the initial post. To view the content without the Sponsor Links please click here.

Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.