Abstract:
This paper puts forward the method of XML document based on linked-structure. It uses stream tokenizer to design an algorithm of HTML document parse. The element and text contents are inserted into the correct position to create DOM-parsing-tree as parsing. Lastly. After visiting the tree and storing the information into a binary-linked-list, it uses a modified preorder algorithm visiting the linked-list, then extracts corresponding information to build DTD and finish the whole generation process.
Key words:
HTML,
XML,
Document object model(DOM),
Parse
摘要: 提出了一种基于链式结构的XML文档生成方法,设计了一个利用Java中的stream tokenizer类实现HTML文档解析的算法,将解析得到的元素内容及文本内容生成的结点插入到相应的位置上,同步生成DOM解析树,对DOM解析树进行遍历,将遍历得到的信息以二叉链表的形式存储,采用改进的先根遍历算法对该二叉链表遍历,提取相应的信息构建DTD,完成整个转换生成的过程。
关键词:
HTML,
XML,
DOM,
解析
CHEN Zailiang; XU Dezhi; CHEN Xuegong; SHEN Hailan. Generation Method of XML Document Based on Chain-link Structure[J]. Computer Engineering, 2006, 32(20): 59-61.
陈再良;徐德智;陈学工;沈海澜. 基于链式结构XML文档的生成方法[J]. 计算机工程, 2006, 32(20): 59-61.