机构地区: 中国科学院研究生院
出 处: 《计算机工程与应用》 2006年第9期89-92,共4页
摘 要: XML文件作为配置文件是很多系统的首选,但是目前针对XML文件的配置信息提取与配置文件的构造技术都缺乏通用性,效率较低,扩展性很差。针对这一问题,论文提出了一种通用的基于表格驱动的XML配置文件解析与构造技术。该技术具有如下几个特征:第一,采用表格驱动,用表格来表示XML的结构信息,可实现配置信息更加严格的验证;第二,利用表格中的槽(slot)结合函数回调来提取配置信息和生成配置文件,使数据和对数据的操作分开,降低了与配置文件的耦合性,同时也使解析和构造统一化,具有高效性。第三,采用基于插件的开放式架构,通过扩展插件可以解析、生成任何复杂的配置文件,具有易扩展性;实际应用表明,论文提出的XML配置文件解析与构造技术具有通用性、易扩展性和高效性。 XML configuration files are gaining increasing popularity due to its convenience.But most of the current methods which parse and construct XML configuration files perform poor in efficent,extensibility and generality.In this paper,a table-driven method is proposed to solve this problem.Different from traditional ones,the method has following features,Firstly,it is based on table-driven,and stores XML structure information in tables which can validate the configuration information more strictly,Secondly,by using table's slots and adopting callback function mechanism,it separates data from the operations on them so as to deduce the conpling with configuration files.Finally,it employs plug-in based open framework,with which can parse and construct any complex configuration files.Experimental results also show that our method is general,extensible,and efficient,and very valuable in practice.
领 域: [自动化与计算机技术] [自动化与计算机技术]