XML Styling (was 'Lets try again: XML via QUIZ?')
Victor Geere
victor@nha.co.za
Thu, 4 Jul 2002 15:08:37 +0200
>Anyone have any experience with XML from Quiz? I am especially after any
>tips on how to set up XML cascading style sheets. Thanks
I guess you will end up with a static css page if you generate the page with QUIZ,
which is fine if that is what you want.
Powerhouse web might just save you from reinventing the wheel, but if you insist:
My favourite way of going about this is to write an embedded SQL statement in the web page
that fetches meta data from the database and dynamically formats/constructs the page
before it populates it with data. That way you don't have to change the web page or style sheet
every time your database structure changes. And you can reuse the page by just
changing your SELECT statement.
It is also handy when doing conditional styling
based on the values of the fields (like green positive values and red negative values etc).
It works best with relational databases with a rich meta data layer
but can also be done using a dictionary for flat files. Any deja vu?
You can construct a dynamic XML dictionary from relational meta data
by using a hairy SQL query or QUIZ for a static one, or read on.
--or--
If you
-Don't have a moral objection to using MS products
-Have access to an MS-SQL server
-Don't have to use QUIZ
-Don't have much XML experience
-Don't want to write any code
-Want to create a once off XML dictionary/result set/style sheet.
You can create a linked server in MS-SQL via an OLE DB provider for your database.
Use OLE DB for ODBC in the absence of an OLE DB provider (TurboImage).
And use SQL XML support on IIS to convert your SQL Query into an XML result set on the fly.
(While you are at it, this enables you to access just about any database with Transact SQL,
argueably the richest SQL syntax out there, and export it to anything else).
--or--
If you find yourself in the heart of right-click country,
you can use MS-Access 2000 to generate a style sheet.
Create a linked table in Access.
Generate an empty Access table based on the linked table.
Generate an Access Web page (in Access).
Copy the style sheet, remove references to Access and use it as you like.
--
However you go about this, you can do just about anything if you
can query your database's underlying meta data. Which database are you using?
I've got code for quite a few of them.
Just a thought.
Victor