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. 通过SSIS的“查找”组件进行不同数据源之间数据的合并操作

    原文:通过SSIS的"查找"组件进行不同数据源之间数据的合并操作 为了协助开发还原生产环境中的某些bug,需要将将生产环境的某些特定表数据导入到测试环境做测试,之前一直都是暴力地t ...

  2. Windows完成端口编程

    Windows完成端口编程目录一 基本概念二 OVERLAPPED数据结构三 完成端口的内部机制创建完成端口完成端口线程的工作原理线程间数据传递线程的安全退出 一 基本概念       设备---wi ...

  3. c# 叫号小程序

    写个叫号的小demo 长相如下 代码如下 using System; using System.Collections.Generic; using System.ComponentModel; us ...

  4. DIOCP3 DEMO的编译(去掉VCL前缀)

    总有些朋友问我,关于DEMO编译的一些问题,每次都回答大概都差不多,我想还是写篇说明书给大家,关于DEMO编译的步骤. [环境设定] 1.将DIOCP3\source路径添加到Delphi的搜索路径, ...

  5. 快速开发平台 WebBuilder 8.4 发布

    WebBuilder是一款强大,全面和高效的应用开发和运行平台.基于浏览器的集成开发环境,可视化和智能化的设计,能轻松完成常规应用和面向手机的移动应用开发.高效.稳定和可扩展的特点,适合复杂企业级应用 ...

  6. 用node.js(socket.io)实现数据实时推送

    在做商品拍卖的时候,要求在商品的拍卖页面需要实时的更新当前商品的最高价格.实现的方式有很多,比如: 1.setInterval每隔n秒去异步拉取数据(缺点:更新不够实时) 2. AJAX轮询方式方式推 ...

  7. JavaScript规定了几种语言类型?

    JavaScript中的每一个值都有它自己的类型,JavaScript规定了七种语言类型: 1.Undefined 2.Null 3.Boolean 4.String 5.Number 6.Symbo ...

  8. Django 强大的ORM之增删改查

    Django orm         Django——orm进阶 测试Django中的orm 表结构: models.py class User(models.Model): name = model ...

  9. mini木马c源码

    #pragma comment(lib, "ws2_32.lib") #pragma comment(linker,"/subsystem:\"windows\ ...

  10. jsp路径兼容

    jsp头 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8&q ...