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. 搭建svn服务器&服务器客户端使用笔记

    参考借鉴文章:http://www.cnblogs.com/vijayfly/p/5711962.html 之前尝试着用git管理公司代码,但被一个问题困惑了很久无法解决,那就是git该如何只pull ...

  2. WPF应用程序如何重启当前的Application

    // Restart current process Method 1 System.Windows.Forms.Application.Restart(); Application.Current. ...

  3. .gitignore 配置后无效

    利用.gitignore过滤文件,如编译过程中的中间文件,等等,这些文件不需要被追踪管理. 现象: 在.gitignore添加file1文件,以过滤该文件,但是通过Git status查看仍显示fil ...

  4. HUSTOJ的Windows版评判内核(限制内存使用)

    HUSTOJ的Windows版评判内核(一) 作者:游蓝海 个人主页:http://blog.csdn.net/you_lan_hai 2013.4.9 注:最新版本项目地址:https://gith ...

  5. MyCat的初步了解

    MyCat 1 开源数据库中间件 MyCat   如今随着互联网的发展,数据的量级也是撑指数的增长,从GB到TB到PB.对数据的各种操作也是愈加的困难,传统的关系性数据库已经无法满足快速查询与插入数据 ...

  6. Android Java调用Qt写的so库

    有时候,我们反编译apk得到一个so库,如果直接使用这个so库的话,必须使用原来so库同样的package名字,才能用.这样人家反编译你的apk,就知道你侵犯了人家的版权.为了达到混淆的目的,我们可以 ...

  7. TCP使用注意事项总结

    目录 发送或者接受数据过程中对端可能发生的情况汇总 本端TCP发送数据时对端进程已经崩溃 本端TCP发送数据时对端主机已经崩溃 本端TCP发送数据时对端主机已经关机 某个连接长时间没有数据流动 TCP ...

  8. 04 Javascript的运算符

    js中的运算符跟python中的运算符有点类似,但也有不同.所谓运算,在数学上,是一种行为,通过已知量的可能的组合,获得新的量. 1.赋值运算符 以var x = 12,y=5来演示示例| 2.算数运 ...

  9. vue结合Ant Design实现后台系统的权限分配(支持无限子级嵌套)

    最近公司的业务需要,要做一个后台管理系统的管理系统类似于这样子 功能需求如下: 左边是权限菜单,右边对应的是具体权限. 1.父级权限菜单选中,父级权限菜单的权限包括其中所有子级权限菜单的权限也要选中, ...

  10. 【过时】项目转Maven后出现的问题记录

    上图,文字后补充 1.过程 创建一个新的web项目,项目名称与原项目名称一致.注意勾选“添加mvn支持(红框部分)”,勾选后运行目标服务器会变为none,这里无法进行添加. 2.项目创建完成后,会报错 ...