RE: What I need from XML

by "David Wagner" <dwagner(at)kevric.com>

 Date:  Mon, 20 Mar 2000 16:32:59 -0600
 To:  "HWG XML LIST (E-mail)" <hwg-xml(at)hwg.org>
  todo: View Thread, Original
I have been working on a general purpose tool to do just what
you describe, and just found the last bit of information I need
to finish an alpha implementation.  What you describe may
actually be easier than you think.  If you don't mind writing
XML and XSLT markup directly, you need as a minimum only two
files and one application: an XSLT processor suppoting multiple
file output such as James Clarks's XT
<http://www.jclark.com/xml/xt.html>.  If you would rather use
XML and XSL tools to create and edit your source documents,
there are some available at the links others have provided.
For your particular application, however, you may wish to add a
third component and store the basic product information in a
relational database, though this is not necessary and adds a
level of complexity to the process though it may make inventory
tracking easier.

The simplist solution is to store all your site information in
an (read one) XML file.  You may use XHTML, or a custom XML
file.  (I am currently working on a general resource
description framework (RDF) DTD for website generation.)  Then,
create an XSLT file to transform the XML into all the pages in
your website, using the multiple file output XSL extension to
put different markup versions (HTML4, ISOHTML, HTML4 for NN,
WML, and so on ad nauseum) of each page in different directory
structures.  Execute one command to regenerate your entire site
when you update the XML file.

The complexity comes in defining page elements (navigation bar,
order form, product list, product detail card, and so on) and
specifying the different markup for each version of the site.
However, once you have layed out your pages for each target
browser you never need to do so again.  Put stylistic
information like colors and font-families into XSLT root
variables for easy update later.  (You can even generate
different external stylesheets for each browser.)

Oh, yes.  If you haven't worked with XSLT yet, be prepared for
a mind-bending experience.  You need to work with at least
three languages at once (input XML, output ML, and XSLT
itself), and XSLT does NOT process sequentially line-by-line
like a programming language, but parses from the inside out
from the document root to branches.  Finding and fixing bugs can be
exasperating.

Good luck, and keep us posted!
-David

Catharina Hogarth wrote
> My husband and I have a collection of antique arms and armour
> and I am in
> the process of redesigning our website.  Ideally I would like
> to be able
> to simply create a database (XML?) that would hold the
> various elements of
> each piece (name, circa date, category, maker, measurements,
> description,
> etc.)
>
> I would then like to offer this information in different formats for
> different web browsers and even a basic text version (for printing
> perhaps?).  To create this in HTML in all the different
> styles that would
> optimize the viewer's experience depending on their browser,
> would take a
> lifetime to create and then maintain after it's done.  We are
> constantly
> adding new items and I have been known to make mistakes from
> time to time
> ;-) so I'd like to only have to change the database and all
> the pages that
> reference it would also change.
>
> If I can have the visitor choose their browser when they come into the
> site (or set up a CGI script to detect that) and then steer
> them to the
> correct directory, I would like to set up a series of pages that would
> access 1 database but display the information in different styles.
>
> I've studied the basic elements of XML and I think it may be
> the answer
> but have yet to learn how I can put the different sites
> together once the
> database is created.

HWG hwg-xml mailing list archives, maintained by Webmasters