Lists Home |
Date Index |
- From: Sean Mc Grath <email@example.com>
- To: firstname.lastname@example.org
- Date: Mon, 22 Dec 1997 17:12:01 GMT
>Force: flexible and adaptive software needs meta-information:
[Much interesting stuff deleted]
Here is a technique we use here that I find *very* useful and *very* general.
Someone out there might find it useful or know a better way to do it.
When building particular configurations - either of software or documents - we
build a "project file" (in XML of course). They all look at bit like this (this
one is for a Document Database):
<Level title = "Company Law">
<Level title = "Companies Acts">
<Level title = "Companies Act 1985">
<file name = "uk85p1">
<Level title = "Auditing Guidelines">
<Level title = "Statements of Accounting Practice">
This is a "configuration" file basically. We might have a dozens of
scripts to run against this project to build different things.
We don't want to have to manage oodles of little
scripts all over the place, most of which need the meta-information.
We tack the scripting stuff on to the configuration file (here using Python):-
<Python name = "Do Something With The Files">
# THis script *knows* about the project file it itself is in
# it is in the Project variable
# Move to the Companies Act 1985 Node
Project.Seek ("Level","title","Companies Act 1985")
flist = GetChildren(...)
# Do something useful
<Python name = "Some Other Interesting Script">
To run a particular script we load this XML file, locate the named Python
Node and Execute its
contents. The loader ensures that the code has acccess to the XML Tree
structure in the variable
This is a bit weird at first sight. A project file that contains the
meta-data about a project
and also the scripting required to operate on the meta-data:-)
I find this hugely useful in practice. Note that the technique relies on the
Python allows you to evaluate a lump of code at run-time. Perl is the same.
Dunno about Java.
Sean Mc Grath
sean at digitome dot com
xml-dev: A list for W3C XML Developers. To post, mailto:email@example.com
Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/
To (un)subscribe, mailto:firstname.lastname@example.org the following message;
To subscribe to the digests, mailto:email@example.com the following message;
List coordinator, Henry Rzepa (mailto:firstname.lastname@example.org)