• 软件测试技术
  • 软件测试博客
  • 软件测试视频
  • 开源软件测试技术
  • 软件测试论坛
  • 软件测试沙龙
  • 软件测试资料下载
  • 软件测试杂志
  • 软件测试人才招聘
    暂时没有公告

字号: 小 中 大 | 推荐给好友 上一篇 | 下一篇

dom规范和java中的实现(二)

发布: 2007-7-01 20:40 | 作者: admin | 来源: | 查看: 13次 | 进入软件测试论坛讨论

领测软件测试网

基本接口接口定义():

类继承图(箭头指向的是父类,另一端为子类)

1.Node接口

     Node接口在整个DOM树中具有举足轻重的地位,DOM接口中有很大一部分接口是从Node接口继承过来的,例如,Element、Attr、CDATASection等接口,都是从Node继承过来的。在DOM树中,Node接口代表了树中的一个节点。

Field Summary

static short


          The node is an Attr.

static short


          The node is a CDATASection.

static short


          The node is a Comment.

static short


          The node is a DocumentFragment.

static short


          The node is a Document.

static short


          The node is a DocumentType.

static short


          The node is an Element.

static short


          The node is an Entity.

static short


          The node is an EntityReference.

static short


          The node is a Notation.

static short


          The node is a ProcessingInstruction.

static short


          The node is a Text node.

 

Method Summary

 

( newChild)
将节点对象添加到本节点的子节点列表的末尾

 

(boolean deep)
创建新的节点对象,他是本节点的克隆,如果deep=true,他将包含本节点的所有子孙节点。

 

()
如果是节点,返回一个包含所有属性的NamedNodeMap对象,否则为空。

 

()
返回包含所有子节点的NodeList对象

 

()
得到第一个子节点

 

()
得到最后一个子节点

 java.lang.String

()
返回本节点合法名字的本地部分

 java.lang.String

()
返回本节点命名空间的URI,未指明的话返回null

 

()
得到本节点的下一个兄弟节点

 java.lang.String

()
得到本节点的名字

 short

()
得到一个节点类型

 java.lang.String

()
得到一个节点值

 

()
返回本节点所属的Document对象

 

()
得到父节点

 java.lang.String

()
返回本节点的命名空间前缀,如果未指定返回null

 

()
得到本节点的上一个兄弟节点

 boolean

()
返回是否有属性

 boolean

()
返回本节点是否有任何子节点

 

( newChild,  refChild)
在参考节点refChild前插入新节点newChild

 boolean

(java.lang.String feature, java.lang.String version)
测试version版本的DOM规范是否支持feature特性

 void

()
          Puts all Text nodes in the full depth of the sub-tree underneath this Node, including attribute nodes, into a "normal" form where only structure (e.g., elements, comments, processing instructions, CDATA sections, and entity references) separates Text nodes, i.e., there are neither adjacent Text nodes nor empty Text nodes.

 

( oldChild)
从子节点列中删除节点

 

( newChild,  oldChild)
替换oldChild节点为newChild

 void

(java.lang.String nodeValue)            

 void

(java.lang.String prefix)            


延伸阅读

文章来源于领测软件测试网 https://www.ltesting.net/


关于领测软件测试网 | 领测软件测试网合作伙伴 | 广告服务 | 投稿指南 | 联系我们 | 网站地图 | 友情链接
版权所有(C) 2003-2010 TestAge(领测软件测试网)|领测国际科技(北京)有限公司|软件测试工程师培训网 All Rights Reserved
北京市海淀区中关村南大街9号北京理工科技大厦1402室 京ICP备10010545号-5
技术支持和业务联系:[email protected] 电话:010-51297073

软件测试 | 领测国际 | ISTQB | ISTQB官网 | TMMi | TMMi认证 | 国际软件测试工程师认证 | 领测软件测试网