1 public void read(Element e) {
2 if (e.nodeCount() > 0) {
3 Iterator<?> it = e.elementIterator();
4 while (it.hasNext()) {
5 Element ele = (Element) it.next();
6 read(ele);
7 System.out.println("Element :" + ele.getName() + " Path "
8 + ele.getUniquePath());
9
10 if (ele.attributeCount() > 0) {
11 Iterator<?> ait = ele.attributeIterator();
12 System.out.print(" Data : [ ");
13 while (ait.hasNext()) {
14 Attribute attribute = (Attribute) ait.next();
15 System.out.print(attribute.getName() + " : "
16 + attribute.getData() + " ");
17 }
18 System.out.print(" ]");
19 System.out.println();
20 }
21 }
22 }
23
24 }


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-02-11
  • 2021-11-24
  • 2021-09-18
  • 2021-07-22
  • 2021-10-14
相关资源
相似解决方案