摘要
XML是可扩展标记语言,开发者可根据需要定义合适的标记。由于其灵活性,已被广泛应用于各个领域。主要讨论XML语法检查的两种方法,着重分析其中的一种,并给出具体的实现算法、对XML语法进行检查包括两部分,XML的有效性检查和XML的结构良好性检查。首先对表示XML文档类型定义(DTD)的局部树语法进行改进,然后在DTD构造的语法基础上,对XML进行有效性检查,针对语法检查的两个部分分别构造了检查算法。实验结果表明,该语法检查算法是切实可行的。
XML is extensible markup language in which developer can define tags as they need. For its flexibility, it gains attention in many fields. The paper mainly discusses two methods for the XML parsing and lay stress on the second one. XML parsing contains two parts, checking structural validity and checking structural well-formedness. First, a local tree grammar was improved to express DTD. Then, based on this improved grammar, we check the well-formedness of XML. The algorithm 1 and algorithm 2 are put forward to check structural validity and check structural well-formedness respectively. Experimental results show that the algorithms are feasible.
出处
《计算机工程与设计》
CSCD
2002年第11期86-90,共5页
Computer Engineering and Design