在編修上我們提出目前工作樹(CWT)的概念。當游標落在節點資料內時,是以字元或列為編輯單位;當游標落在次級子樹之間,則是以次級子樹為編輯單位。基本編輯動作都是以CWT的編輯單位為基礎。當游標進入(或退出)子樹時,CWT會縮小(或擴大),由於編輯單位隨著CWT變更,文件就得以保持樹狀結構。此外,樹狀編輯器還支援特種編修動作,包括下推、上拉、標記配置、及標記轉換。 In this paper, the structure of XML documents is analyzed, and its tree model is proposed. Based on the model, the functions of an XML editor on displaying and editing are explored. And a Tree editor for XML documents are designed and implemented.
On displaying, all the tedious tags and white spaces for indent are removed. The user can select the types of nodes to display, maximize/minimize a sub-tree, and use the local scrolling bar of a sub-tree.
On editing, the concept of current working tree (CWT) is proposed. While the text cursor is located in node data, the unit of editing is a character or a line. While it is located between next-level sub-trees, the unit of editing is a next-level sub-tree. Elementary editing actions must base on the unit of editing. When the cursor enters or exits a sub-tree, the CWT will shrink or expand respectively. Since the unit of editing changes as well as the CWT, the tree structure of a document will be well preserved. Besides, special editing actions such as pushing down, pulling up, markup labeling, and markup transformation are supported by our tree editor.