首页 > 设计 > 媒体动画 > 正文

Authorware类和函数:authorware7.0脚本教学文章连载--XmlParser Xt

2020-09-19 18:44:29
字体:
来源:转载
供稿:网友

doneparsing

语法:result:=callobject(object,"doneparsing")

说明:如果xml字符串解析完毕则返回true。

getattributename

语法:result:=callobject(object,"getattributename",ichild,"xmlnode")

说明:返回指定节点的某一属性名。节点号由参数xmlnode指定,属性号由参数ichild指定。

getattributevaluebyindex

语法:result:=callobject(object,"getattributevaluebyindex",ivalue,"xmlnode")

说明:根据属性号,返回指定节点的某一属性的值。节点号由参数xmlnode指定,属性号由参数ivalue指定。

getattributevaluebyname

语法:result:=callobject(object,"getattributevaluebyname","attributename","xmlnode")

说明:根据属性名称,返回指定节点的某一属性的值。节点号由参数xmlnode指定,属性名称由参数attributename指定。

getchild

语法:result:=callobject(object,"getchild",ichild,"xmlnode")

说明:返回指定xml节点的子节点。例如,第1个结点的第5个子节点表示为“1,5”。xml节点由参数xmlnode指定,根节点对应于0或“0”,子节点序号由参数ichild指定。

getcount

语法:result:=callobject(object,"getcount","objecttype","xmlnode")

说明:返回指定xml节点的子节点或属性的数量。节点号由参数xmlnode指定。参数objecttype取值为“#attribute”时,该方法返回属性的数量;取值为“#child”时,该方法返回子节点的数量。

geterror

语法:result:=callobject(object,"geterror")

说明:返回xml字符串解析过程中出现的错误。

getname

语法:result:=callobject(object,"getname","xmlnode")

说明:返回指定xml节点的名称。节点号由参数xmlnode指定。

gettext

语法:result:=callobject(object,"gettext","xmlnode")

说明:如果指定xml节点的类型为text,则返回该节点的内容。节点号由参数xmlnode指定。

gettype

语法:result:=callobject(object,"gettype","xmlnode")

说明:返回指定xml节点的类型,可能的返回值是element或text。节点号由参数xmlnode指定。

ignorewhitespace

语法:result:=callobject(object,"ignorewhitespace",ignore)

说明:设置是否忽略元素开始标记与结束标记之间的空白字符(例如,回车,换行,tab或空格)。参数ignore可以为true或false。默认的设置为true。

makelist

语法:result:=callobject(object,"makelist")

说明:将xml字符串转换为authorware列表。

newobject

语法:object:=newobject("xmlparser")

说明:创建一个新的xmlparser xtra对象。

parsefile

语法:result:=callobject(object,"parsefile","file")

说明:对指定url地址处的xml文档进行解析,参数file用于指定url地址。可以通过doneparsing方法检测解析过程是否结束,通过parsemore方法来强制读取和解析更多的数据。

parsemore

语法:result:=callobject(object,"parsemore")

说明:解析更多的xml文档。

parsestring

语法:result:=callobject(object,"parsestring",data)

说明:对xml字符串进行解析。参数"data"就是xml字符串。

发表评论 共有条评论
用户名: 密码:
验证码: 匿名发表