Changeset 3466
- Timestamp:
- 2002-10-16T09:22:25+13:00 (22 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl3/src/java/org/greenstone/gsdl3/util/GSXML.java
r3362 r3466 294 294 return p; 295 295 } 296 297 /** returns the element parent/node_name[@attribute_name='attribute_value'] 298 */ 299 public static Element getNamedElement(Element parent, String node_name, 300 String attribute_name, 301 String attribute_value) { 302 303 NodeList children = parent.getChildNodes(); 304 for (int i=0; i<children.getLength(); i++) { 305 Node child = children.item(i); 306 if (child.getNodeName().equals(node_name)) { 307 if (((Element)child).getAttribute(attribute_name).equals(attribute_value)) 308 return (Element)child; 309 } 310 } 311 // not found 312 return null; 313 } 296 314 }
Note:
See TracChangeset
for help on using the changeset viewer.