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. 零元学Expression Blend 4 - Chapter 46 三分钟快速充电-设定Margin的小撇步

    原文:零元学Expression Blend 4 - Chapter 46 三分钟快速充电-设定Margin的小撇步 如果需要经常的使用某一项工具,总会希望能够更快速的使用各项设定达到效果 今天要介绍 ...

  2. 初涉Delphi Socket编程

    不是第一次接触socket编程了,但以前都是看别人的依葫芦画瓢,也不知道具体的原理. 新的项目,有了新的开始,同时也需要有新的认识. Delphi 中带有两套TCP Socket组件: Indy So ...

  3. 这里有123个黑客必备的Python工具!

    123个Python渗透测试工具,当然不仅于渗透~ 如果你想参与漏洞研究.逆向工程和渗透,我建议你时候用Python语言.Python已经有很多完善可用的库,我将在这里把他们列出来. 这个清单里的工具 ...

  4. .NET程序员如何快入门Spring Boot

    本篇文章将教你作为一个.NET程序员如何快入门Spring Boot.你不需要用Eclipse,也不需要用IDEA.已经习惯了VS,其他的IDE-- 但不得不说VS Code很厉害,一用就喜欢.微软给 ...

  5. java多线程之管道流

    java语言中提供了各种各样的流供我们操纵数据,其中管道流(pipeStream)是一种特殊的流,用于在不同线程间直接传送数据. 一个线程发送数据到输出管道,另一个线程从输入管道读取数据,通过使用管道 ...

  6. 30411MySQL安装与配置_win10

    1 下载 1.1下载地址 下载地址  https://downloads.mysql.com/archives/community/ 1.2 选择适合自己的版本并下载 1.3 将下载文件解压至自定义路 ...

  7. java集合的方法及使用详解

    一.java集合的分类及相互之间的关系 Collection接口:向下提供了List和Set两个子接口 |------List接口:存储有序的,存储元素可以重复 |------ArrayList(主要 ...

  8. Oracle分组函数之ROLLUP用法

    rollup函数 本博客简单介绍一下oracle分组函数之rollup的用法,rollup函数常用于分组统计,也是属于oracle分析函数的一种 环境准备 create table dept as s ...

  9. 【Netty整理02-详细使用】Netty入门

    重新整理版:https://blog.csdn.net/the_fool_/article/details/83002152 参考资料: 官方文档:http://netty.io/wiki/user- ...

  10. eclipse中junit简单使用

    1.在工程中右击 Build Path,Add libraries 然后就可以运行对应的方法了,不需要main方法调用了