Help coderanch get a
new server
by contributing to the fundraiser
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Is this a GOOD use of XML?

Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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 ]
pie. tiny ad:
We need your help - Coderanch server fundraiser
    Bookmark Topic Watch Topic
  • New Topic