my dog learned polymorphism
The moose likes XML and Related Technologies and the fly likes Is this a GOOD use of XML? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Is this a GOOD use of XML?" Watch "Is this a GOOD use of XML?" New topic

Is this a GOOD use of XML?

Heath Lilley
Ranch Hand

Joined: Jan 09, 2001
Posts: 72
Hello all,
The Problem...
I am creating an application that is going to generate customer readable literature from a database. This in formation needs to be somewhat customized to the customer based on some sort of project that we have/are going to do for them.
The deal is i have several items/materials that will be used on the project and depending on the items there uses will change. And i need to develop a way to interchange the usage description text for a given item based on the type of the item....
An Example...
I have 2 types of paint (acrylic and latex)
Latex is used in 3 coats, indoor surfaces only.
Acrylic is used in 4 coats outdoor surfaces only.
I need to out put...
The Acrilic Green paint will be applied in 4 coats for every external surface.
The Latex Green paint will be applied in 3 coats for every internal surface.

A Proposed solution...
So I was thinking of storing the display text as a field for this material in a DB table as something like the following...
(this is only formatted for clarity)

I could then write a parser to read through the above string and parse out what I need based on the rules i have in place.
The Question...
Is this a valid use of XML? I am pretty sure I could do it this way but is it a "good" solution. I guess I am looking for other examples or "cook books" for this kind of problem.

Any help is greatly appreciated.
Thank you.
[ April 22, 2003: Message edited by: Heath Lilley ]
I agree. Here's the link:
subject: Is this a GOOD use of XML?
It's not a secret anymore!