From: Justin Y. <ju...@sk...> - 2002-11-22 01:50:21
|
Here's an update on the parsers: The current CVS version should be fully working, and should not break anything else (apart from the deal w/ having to call them using the method outlined in /src/parsers/README and not being able to tell them the files to read/write from as a command line argument). XML rewriting is now possible (and is explained in /src/parsers/README). The base parsers do NOT rewrite XML, and I think it would be a good idea to keep it that way. So, using the Ini parser will give the exact same XML as it gave previously. However, calling the Ini::Samba parser will give the same XML but with rewritten XML tags, using <sambaglobal> <sambaprinter> <sambahomes> and <sambashare> for sections, and either <string> or <boolean> for property tags. The rewrite rules are in /src/parsers/CFGXML/Parsers/Ini/Samba.pm (the only parser that rewrites anything currently) if anyone is curious. The same set of rules are used by both the parsing and unparsing process. They're done using hash tables, and I've tried to cache as much as possible, so there shouldn't be a significant speed hit once the rules get complex. I'm wondering about are what exactly we should do to identify sections versus properties, and what to do about having the names of properties & sections be attributes versus child tags. If the GUI or some other layer is using the XML class files to determine how to display them, it *could* look at the inheritance to determine whether a tag is inherited from a section or not, right? Or is that difficult to do? Justin -- SkiingYAC.com Custom Solutions su...@sk... http://www.SkiingYAC.com |