Provides lookup of elements by non-namespaced name @param key the name (or shortcut key) of the node(s) of interest @return the nodes which match key
(String key)
| 512 | * @return the nodes which match key |
| 513 | */ |
| 514 | public Object get(String key) { |
| 515 | if (key != null && key.charAt(0) == '@') { |
| 516 | String attributeName = key.substring(1); |
| 517 | return attributes().get(attributeName); |
| 518 | } |
| 519 | if ("..".equals(key)) { |
| 520 | return parent(); |
| 521 | } |
| 522 | if ("*".equals(key)) { |
| 523 | return children(); |
| 524 | } |
| 525 | if ("**".equals(key)) { |
| 526 | return depthFirst(); |
| 527 | } |
| 528 | return getByName(key); |
| 529 | } |
| 530 | |
| 531 | /** |
| 532 | * Provides lookup of elements by QName. |
no test coverage detected