[PW-dev] XML configuration
Status: Alpha
Brought to you by:
spadkins
|
From: James G S. <JG...@TA...> - 2001-06-28 18:58:54
|
I finally got XML::Parser to not dump core on me, so now I can
continue testing/developing in a mod_perl env. (solution: make
Apache use the system expat lib instead of its own).
Basically, I've gotten the XML configuration to the point where
the following is possible:
<configuration>
<classes>
<map>
<citys>
<hash>
<a>Albuquerque</a>
<b>Belen</b>
<c>Chama</c>
<e>Elephant Butte</e>
<f>Farmington</f>
</hash>
</citys>
<city>Albuquerque</city>
<interstate>
10
<values>
<hash>
<10>Interstate 10</10>
<25>Interstate 25</25>
<40>Interstate 40</40>
</hash>
</values>
</interstate>
</map>
</classes>
<widgets>
<title>Page title</title>
</widgets>
</configuration>
Defines a class called 'map' which defines the values for two
widgets named 'city' and 'interstate'. One widget with the name
'title' is configured with a value of 'Page title'.
I'm still trying to think about how to do plurals from singular
forms (value -> values). This means that the 'city' tag
designates the default value for the widget of that name while
'citys' or 'cities' (hopefully) will designate the set of valid
values. 'value' and 'values' are still valid tags.
Anyone want anything in an XML configuration that isn't here?
Possibilities include code to validate widget values:
<configuration>
<classes>
<date>
<class id="month">
<validate>
<[CODE
if($value > 0 && $value < 13) { return $value; }
return 0;
]>
</validate>
<class>
</date>
</classes>
</configuration>
I haven't even thought about how to work that into the code yet.
--
James Smith <JG...@TA...>, 979-862-3725
Texas A&M CIS Operating Systems Group, Unix
|