Element element =ele.element(“书名");
List elementList =ele.elements(“书名");
List elementList =ele.elements();
</pre><span style="font-size:16pt"><span style="font-family:Wingdings; font-size:70%"></span></span><p></p><p style="margin-top:3.84pt; margin-bottom:0pt; margin-left:0.38in; text-indent:-0.38in; direction:ltr; unicode-bidi:embed; vertical-align:baseline"><span style="font-size:16pt"><span style="font-family:Wingdings; font-size:70%"></span></span></p>l<span style="text-indent:-0.38in; font-size:16pt; font-family:Arial">2.</span><span style="text-indent:-0.38in; font-size:16pt; font-family:宋体">获取节点的名字</span><p style="margin-top:3.84pt; margin-bottom:0pt; margin-left:0.38in; text-indent:-0.38in; direction:ltr; unicode-bidi:embed; vertical-align:baseline"></p><pre name="code" class="java"> <span style="white-space:pre"> </span>node.getName();
node.setName(StringnewName);
l4.取得节点的文字(标签体)
String text=node.getText();
node.setText("aaa");
<span style="font-size:12px;"> ele.add(Element e); ele.addElement("age"); </span>
parentElm.remove(childElm);
node.getNodeType() ;
node.getParent();
<span style="white-space:pre"> </span>Attributeattr= ele.attribute("aaa"); Attribute attr= ele.attribute(0); List list = ele.attributes(); String value = ele.attributeValue("aaa"); Iterator it = ele.attributeIterator();
<span style="white-space:pre"> </span>ele.add(Attribute attr); ele.addAttribute(name,value); ele.setAttributes(Listattrs);
<span style="font-size:14px;"> <span style="white-space:pre"> </span>ele.remove(attribute);</span>
Elementaaa = DocumentHelper.createElement("aaa"); aaa.setText("aaa"); Listlist = root.element("书").elements(); list.add(1,aaa);