[XML-SIG] XML appropiate for config files of a xml processor?

Guy Murphy GuyM@eurodatasystems.com
Thu, 9 Nov 2000 13:10:03 -0000


One might consider...

<element xml="example">
    	<start><tag name="p" /><tag name="p" /><tag name="b" /></start>
	<content />
    	<end><tag name="p" /><tag name="p" /><tag name="b" /></end>

...although in the example you cite, the end tags can be infered.

I noted well the advice that you not use XML for config files. At the end of
the day it's a matter of personal taste, but have found that if one pays
attention to extensible ways of expressing config, rather than literal
notation in XML format, XML configs work well.

Why for the example you give do you not simply....

<template:element name="example">
			<b><template:content /></b>

If you use namespaces it clears up a lot of anxiety about confusing the
model of the config from expression of the content.

One might also question why you are not simply relying upon XSL to know how
to represent and "example", given that the config I expressed above is only
a hop, skip and a jump from XSL anyway.

<xsl:template match="example">
				<xsl:value-of select="." />

XSLT is very good at mapping from one data model to another. Why reinvent
the wheel?

So in short: I like XML for config descriptions. Concentrate on expressing
your data, not literally notating it... think in terms of "what do I *need*
to know to process this?", and exclude the rest.

If I've misunderstood your intent or requirements please correct me.



-----Original Message-----
From: Stephan Tolksdorf [mailto:andorxor@gmx.de]
Sent: 9 November 2000 12:33
To: xml-sig@python.org
Subject: [XML-SIG] XML appropiate for config files of a xml processor?


this a design question not directly related to Python.

I'm writing a small homegrown xml processor which is mainly
intended for transforming xml files to html.

At the moment it is configurable by config files written in xml.
But these config files are not easy to manually read or edit as you
have to escape <,>,".
For example a mapping for a xml-tag could look like
<tag xml="example">

The processor should now transform

Obviously you have to use a special XML-Editor to edit these type of
config files.

So, would you say this is an acceptable drawback in comparison to the
flexibility and ease of use of xml as the config file format?
Or would you say one should use a custom format for these config files?
Maybe you could point me to a config file format actually in use with
such type of processor?

I'd be thankful for your answers.

Best Regards,
  Stephan Tolksdorf

XML-SIG maillist  -  XML-SIG@python.org