Provides lookup of elements by name. @param name the name of interest @return the nodes matching name
(String name)
| 554 | * @return the nodes matching name |
| 555 | */ |
| 556 | private NodeList getByName(String name) { |
| 557 | NodeList answer = new NodeList(); |
| 558 | for (Object child : children()) { |
| 559 | if (child instanceof Node childNode) { |
| 560 | Object childNodeName = childNode.name(); |
| 561 | if (childNodeName instanceof QName qn) { |
| 562 | if (qn.matches(name)) { |
| 563 | answer.add(childNode); |
| 564 | } |
| 565 | } else if (name.equals(childNodeName)) { |
| 566 | answer.add(childNode); |
| 567 | } |
| 568 | } |
| 569 | } |
| 570 | return answer; |
| 571 | } |
| 572 | |
| 573 | /** |
| 574 | * Provides a collection of all the nodes in the tree |