十六、nodetypedvalue
含义:以结点预定义的数据类型返回结点的值
语法:pnode.nodetypedvalue
示例:假定当前结点的数据类型是fixed.14.4,下例将以数值返回结点的值,而不是文本一个字符串
this.nodetypedvalue
十七、nodevalue
含义:返回结点的文本
语法:pnode.nodevalue
注意:该方法不用于元素类结点,可用于属性、cdata、注释、文本等结点
示例:当前元素第一个属性的值
this.attributes(0).nodevalue
当前元素内的文本(假定该元素内只有文本,无其它元素,即< mark >text< /mark >,建议多尝几次掌握其确切的用法)
this.firstchild.nodevalue
十八、ownerdocument
含义:返回包含该结点的文档的根
语法:pnode.ownerdocument
注意:该方法用于文档的根结点将出错
十九、selectnodes
含义:给定的样式匹配应用于当前结点并返回匹配的结点集合
语法:pnode.selectnodes("pattern")
提示:pattern的编写与< xsl:for-each >的select属性的值类似,其中以“/”开头表示
从文档的根出发搜索;以“//”开头表遍历文档的所有结点;以“..”开头
表示从当前结点的父结点开始;如果欲从当前结点向下搜索则不能有以上特殊字符打头。
示例:与当前结点同名的元素在其父元素内的个数
childnumber(this.selectnodes("../"+this.nodename+"[end()]").item(0))
当前元素内名字为“skill”的元素的个数
childnumber(this.selectnodes("skill[end()]").item(0))
二十、selectsinglenode
含义:与selectnodes类似,不同的只返回匹配的第一个结点、而不是结点集合
语法:pnode.selectsinglenode("pattern")
示例:与当前结点同名的元素在其父元素内的个数
childnumber(this.selectsinglenode("../"+this.nodename+"[end()]"))
当前元素内名字为“skill”的元素的个数
childnumber(this.selectsinglenode("skill[end()]"))
二十一、text
含义:返回结点与它的子树内的文字内容
语法:pnode.text
示例:整个文档内的文字内容
this.ownerdocument.text
当前元素及其子树的文字内容
this.text
二十二、xml
含义:返回结点及其后代的xml表示
语法:pnode.xml
示例:当前文档的xml内容
this.ownerdocument.xml
另有几个函数不作介绍,列于其下以供参考,如感兴趣,请访问http://msdn.microsoft.com获取详细说明。
formattime(vartime, bstrformat,vardestlocale)
formatdate(vardate, bstrformat,vardestlocale)
apendchild(newchild)
definition
clonenode
insertbefore(newchild, refchild)
parsed
removechild(oldchild)
replacechild(newchild, oldchild)
specified
transformnode(stylesheet)
transformnodetoobject(stylesheet,outputobject)