[XML-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Corrected Re-post with SGML metamorphosed to XML
>[walter.kriha@s...] > >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): <FinancialInformationDatabase> <Level title = "Company Law"> <Level title = "Companies Acts"> <Level title = "Companies Act 1985"> <file name = "uk85p1"/> </Level> </LeveL> <Level title = "Auditing Guidelines"> <Level title = "Statements of Accounting Practice"> <!-- more files here --> ... </Level> </Level> </FinancialInformationDatabase> This is a "configuration" file basically. We might have a dozens of different processing 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"> <[CDATA[ # 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> <Python name = "Some Other Interesting Script"> <[CDATA[ ... ]]> </Python> </FinancialInformationDatabase> 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 "Project". 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 fact that 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:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...) Sean Mc Grath sean at digitome dot com xml-dev: A list for W3C XML Developers. To post, mailto:xml-dev@i... Archived as: http://www.lists.ic.ac.uk/hypermail/xml-dev/ To (un)subscribe, mailto:majordomo@i... the following message; (un)subscribe xml-dev To subscribe to the digests, mailto:majordomo@i... the following message; subscribe xml-dev-digest List coordinator, Henry Rzepa (mailto:rzepa@i...)
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|