中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > Visual C++ > 高级用户界面
dom规范和java中的实现(二)
作者:sunmingdong 时间:2001-09-30 09:50 出处:互联网 责编:chinaitpower
              摘要:dom规范和java中的实现(二)

基本接口接口定义(java API packageorg.w3c.dom):

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

1.Node接口

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

Field Summary

static short

ATTRIBUTE_NODE
          The node is an Attr.

static short

CDATA_SECTION_NODE
          The node is a CDATASection.

static short

COMMENT_NODE
          The node is a Comment.

static short

DOCUMENT_FRAGMENT_NODE
          The node is a DocumentFragment.

static short

DOCUMENT_NODE
          The node is a Document.

static short

DOCUMENT_TYPE_NODE
          The node is a DocumentType.

static short

ELEMENT_NODE
          The node is an Element.

static short

ENTITY_NODE
          The node is an Entity.

static short

ENTITY_REFERENCE_NODE
          The node is an EntityReference.

static short

NOTATION_NODE
          The node is a Notation.

static short

PROCESSING_INSTRUCTION_NODE
          The node is a ProcessingInstruction.

static short

TEXT_NODE
          The node is a Text node.

 

Method Summary

 Node

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

 Node

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

 NamedNodeMap

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

 NodeList

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

 Node

getFirstChild()
得到第一个子节点

 Node

getLastChild()
得到最后一个子节点

 java.lang.String

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

 java.lang.String

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

 Node

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

 java.lang.String

getNodeName()
得到本节点的名字

 short

getNodeType()
得到一个节点类型

 java.lang.String

getNodeValue()
得到一个节点值

 Document

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

 Node

getParentNode()
得到父节点

 java.lang.String

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

 Node

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

 boolean

hasAttributes()
返回是否有属性

 boolean

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

 Node

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

 boolean

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

 void

normalize()
          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.

 Node

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

 Node

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

 void

setNodeValue(java.lang.String nodeValue)            

 void

setPrefix(java.lang.String prefix)            

关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有