Element:

机翻

Element(Element element)         :通过深复制,创建一个element
Element(String name)             :创建一个没有命名空间的element
Element(String name, String uri) :在指定的命名空间下创建一个element

void addAttribute(Attribute attribute)         :为当前的Element添加或替换属性(如果属性拥有同样的URI则替换)
Attribute removeAttribute(Attribute attribute) :移除当前元素的Attribute

void addNamespaceDeclaration(String prefix, String uri):添加一个命名空间的前缀
void removeNamespaceDeclaration(String prefix)         :删除指定前缀的映射。

void appendChild(String text)               :将一个字符串转换成text节点,并添加到当前节点下
void insertChild(String text, int position) :将字符串转换为文本节点,并将该节点插入指定位置。
Nodes removeChildren()                      :从此节点分离所有子节点

Attribute getAttribute(int index)                            :根据index得到一个属性
Attribute getAttribute(String name)                          :在no namespace中根据一个字符串得到一个Attribute,如果no namespace中不存在这个属性,则返回null
Attribute getAttribute(String localName, String namespaceURI):在URI命名空间中,根据一个字符串得到一个Attribute,如果URI命名空间中不存在这个属性,则返回null

String    getAttributeValue(String name):返回no namespace中具有指定名称的属性的值,如果no namespace中没有具有该名称的属性,则返回null。
String    getAttributeValue(String localName, String namespaceURI):返回URI namespace中具有指定名称的属性的值,如果URI namespace中没有具有该名称的属性,则返回null。

String getBaseURI()                                                :返回应该解析此元素中的相对URI的绝对基URI。
int getAttributeCount()                                            :返回此Element的属性数,不计算名称空间声明。
Elements getChildElements()                                        :以文档顺序返回此元素的所有子元素的列表。
Elements getChildElements(String name)                             :返回此元素的子元素列表,其中指定名称为no spacename。
Elements getChildElements(String localName, String namespaceURI)   :返回此元素的子元素列表,其中指定名称为URI spacename。
Element getFirstChildElement(String name)                          :返回此元素的第一个子元素,其中指定名称为no spacename。
Element getFirstChildElement(String localName, String namespaceURI):返回此元素的第一个子元素,其中指定名称为URI spacename。

String getLocalName()                :返回此元素的本地名称,不包括名称空间前缀或冒号。
int getNamespaceDeclarationCount()   :返回此元素上的名称空间声明的数量。
String getNamespacePrefix()          :返回此元素的前缀,如果此元素没有前缀,则返回空字符串。
String getNamespacePrefix(int index) :返回在此元素上声明的indexth命名空间前缀。
String getNamespaceURI()             :返回此元素的名称空间URI,如果此元素不在名称空间中,则返回空字符串
String getNamespaceURI(String prefix):返回映射到此元素中指定前缀的名称空间URI
String getQualifiedName()            :返回此元素的完整名称,包括此元素具有的名称空间前缀。
String getValue()                    :返回XPath .0定义的元素的值。

void setBaseURI(String URI)
void setLocalName(String localName)
void setNamespacePrefix(String prefix)
void setNamespaceURI(String uri)

Element copy()                 :对当前Element进行深度复制,复制后的Element没有双亲,可以添加到一个Document或者另一个Element下
protected Element shallowCopy():使用相同的名称和名称空间URI创建非常浅的元素副本,但不包含子项,属性,基URI或名称空间声明。

String    toXML():返回当前Element XML序列化后的字符串

nu.xom:Element的更多相关文章

  1. nu.xom:Serializer

    Serializer: 机翻 /* 使用用于控制空格,规范化,缩进,换行和基本URI的各种选项以特定编码输出Document对象 */ Serializer(OutputStream out) :创建 ...

  2. nu.xom:Document

    Document: 机翻 Document(Document doc):创建此文档的副本. Document(Element root):使用指定的根元素创建新的Document对象. DocType ...

  3. nu.xom:Attribute

    Attribute: 机翻 Attribute copy():生成一份当前Attribute的拷贝,但是它没有依附任何Element Node getChild(int position) :因为At ...

  4. XML2JSON 的【net.sf.json.JSONException: nu.xom.ParsingException must be followed by either attribute specifications, ">" or "/>"】问题解决办法

    在使用JSon-Lib库进行XML2JSon的转换时,在JUnit测试时没有什么问题,但是在Tomcat里面跑的时候,抛出了下面的异常,查找了google,发现关于这方便的文章比较少,即使有,也需要F ...

  5. json转xml报[java.lang.NoClassDefFoundError: nu/xom/Serializer]

    原文:http://blog.csdn.net/figo645/article/details/48413571 开始学习JSON了,那么很自然的,我开始要熟悉一些基本的JSON语法 {}代表对象,[ ...

  6. Mongodb:修改文档结构后出现错误:Element '***' does not match any field or property of class ***.

    Mongodb:修改文档结构后出现错误:Element '***' does not match any field or property of class ***. Mongodb是一种面向文档的 ...

  7. selenium+python自动化88-批量操作循环点击报错:Element not found in the cache - perhaps the page has changed since it was looked up

    前言 selenium定位一组元素,批量操作循环点击的时候会报错:Element not found in the cache - perhaps the page has changed since ...

  8. async-validator:Element表单验证

    转载文章:Element表单验证(2)   Element表单验证(2) 上篇讲的是async-validator的基本要素,那么,如何使用到Element中以及怎样优雅地使用,就在本篇. 上篇讲到a ...

  9. Vue 组件库:Element

    目录 Element 介绍 什么是 Element ? Element 快速入门 Element 常用组件 基础布局 容器布局 表单组件 表格组件 顶部导航栏组件 侧边导航栏组件 Element 介绍 ...

随机推荐

  1. 1. linux系统简介

    一.Linux是什么 linux位于系统调用和内核的那两层,直观上来看,我们使用的操作系统还包含一些在其上运行的应用程序,包含文本编译器,浏览器,电子邮件. 二.Linux与windows的区别 1. ...

  2. web-dev-server配置

    webpack-dev-server是一个小型的Node.js Express服务器,它使用webpack-dev-middleware来服务于webpack的包,除此自外,它还有一个通过Sock.j ...

  3. How to manipulate pixels on a bitmap by scanline property(Ma Xiaoguang and Ma Xiaoming)

    We have been developing image processing software for above 14 years with old versions of Delphi, su ...

  4. 【转】在C#中简单的科学计算,包括幂数,指数,对数,Math类

    用Math类进行一些简单的科学计算,包括幂数,指数,对数等的计算: double m,n; m=Math.Exp(0.5); //自然对数e的0.5次方 n=Math.Exp(); //自然对数e的3 ...

  5. 为什么360、百度、腾讯出的Mac端云盘客户端都只有同步盘?(用户量小,同步盘开发成本低,Linux下都没有客户端)

    如题,顾名思义,同步盘是用来同步的,不具备增量的功能,像这三家在Windows端出的客户端都是即有同步也有增量的. 陆续出来的,可能大家更多的是跟随策略,不得不提dropbox是这样的形式.mac电脑 ...

  6. JS获取a标签的Href 内容

    <script type="text/javascript">function getHref(obj){ alert(obj.href);} </script& ...

  7. 用Delphi实现文件下载的几种方法(三种使用控件的方法)

    有个API就是UrlDownloadToFile.不仅如此,Delphi的一些控件也可以轻松实现下载,如NMHTTP,指定NMHTTP1.InputFileMode := ture; 指定Body为本 ...

  8. Delphi移动开发笔记(一)

    Delphi从XE4版本就开始支持移动开发了,但是笔者最近才开始学习这块内容.因为笔者原来一直使用的是Delphi7,对于很多新语法没有了解过,所以把其中一些东西记录下来.        程序开发,调 ...

  9. mstsc也要使用/admin参数

    mstsc.exe /admin http://stackoverflow.com/questions/6757232/service-not-responding-error-1053

  10. QT中获取选中的radioButton的两种方法(动态取得控件的objectName之后,对名字进行比较)

    QT中获取选中的radioButton的两种方法   QT中要获取radioButton组中被选中的那个按钮,可以采用两种如下两种办法进行: 方法一:采用对象名称进行获取 代码: 1 QRadioBu ...