Changeset 15191 for greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
- Timestamp:
- 2008-04-14T16:20:45+12:00 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
greenstone3/branches/customizingGreenstone3/src/java/org/greenstone/gsdl3/util/GSXML.java
r14641 r15191 694 694 return null; 695 695 } 696 /** returns a NodeList of elements: ancestor/node_name[@attribute_name='attribute_value'] 697 */ 698 public static NodeList getNamedElements(Element ancestor, String node_name, String attribute_name, String attribute_value) { 699 MyNodeList node_list = new MyNodeList(); 700 NodeList children = ancestor.getElementsByTagName(node_name); 701 702 if(children != null && children.getLength() > 0) { 703 704 for (int i=0; i<children.getLength(); i++) { 705 Node child = children.item(i); 706 if (child.getNodeName().equals(node_name)) { 707 if (((Element)child).getAttribute(attribute_name).equals(attribute_value)) 708 node_list.addNode(child); 709 } 710 } 711 } 712 return node_list; 713 } 696 714 697 715 public static int SORT_TYPE_STRING = 0;
Note:
See TracChangeset
for help on using the changeset viewer.