- 0
- 0
- 约7.07万字
- 约 7页
- 2016-12-29 发布于贵州
- 举报
= targ=_self/
MenuItem text=空白解决方案... icon= href= targ=_self/
/SubMenu
SubMenu text=打开 icon=images/folder.gif href= targ=_self
MenuItem text=项目... icon= href= targ=_self/
MenuItem text=Web上的项目... icon= href= targ=_self/
MenuItem text=文件... icon= href= targ=_self/
MenuItem text=来自Web的文件... icon= href= targ=_self/
MenuItem text=转换... icon= href= targ=_self/
/SubMenu
MenuItem text=关闭 icon= href= targ=_self/
MenuItem text=- icon= href= targ=_self/
SubMenu text=添加项目 icon= href= targ=_self
MenuItem text=新建项目... icon= href= targ=_self/
MenuItem text=现有项目... icon= href= targ=_self/
MenuItem text=Web上的现有项目... icon= href= targ=_self/
/SubMenu
MenuItem text=- icon= href= targ=_self/
MenuItem text=退出 icon= href= targ=_self/
/Menu
Menu text=编辑 icon= href= targ=_self
MenuItem text=撤销 icon= href= targ=_self/
MenuItem text=重复 icon= href= targ=_self/
MenuItem text=- icon= href= targ=_self/
MenuItem text=剪切 icon= href= targ=_self/
MenuItem text=复制 icon= href= targ=_self/
MenuItem text=粘贴 icon= href= targ=_self/
MenuItem text=- icon= href= targ=_self/
SubMenu text=文本格式 icon= href= targ=_self
SubMenu text=艺术格式 icon= href= targ=_self
MenuItem text=艺术1 icon= href= targ=_self/
MenuItem text=艺术2 icon= href= targ=_self/
/SubMenu
/SubMenu
MenuItem text=选项... icon= href= targ=_self/
/Menu
/Data
定义菜单结构相对比较容易,下一部分介绍如何通过javascript来解析XML数据。
第二部分 Javascript读取XML数据 对应程序文件TMenuXML.js
定义了良好的XML格式数据之后就可以通过Javascrip读取了,这里我们定义了一个javascrip类,用来读取:
function TMenuXML(_filename){
this.isShowTree = false;
//需要装载的XML文件名称
var XMLFileName=_filename;
//javascrip XML 对象
var XMLDoc = new ActiveXObject(MSXML2.DOMDocument.3.0);
//到文件左边的空格数量
var LeftMargin=0;
//对象初始化函数
this.Create=function(){}
//取得节点的数据、文本
//也可以取得节点属性的值
this.getNode=function(doc, xpath) {}
//递归读取下一个需要循环的菜单
this.getNextNode=function(_Node){}
//构造菜单
this.BuildMenu=function(_Menus){}
this.getLeftMarginStr=function(){}
}
大家可以看到,解析XML是通过微软的M
原创力文档

文档评论(0)