- Timestamp:
- 2018-10-18T21:22:13+02:00 (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/org/openstreetmap/josm/tools/XmlUtils.java
r13901 r14348 18 18 19 19 import org.w3c.dom.Document; 20 import org.w3c.dom.Element; 21 import org.w3c.dom.Node; 22 import org.w3c.dom.NodeList; 20 23 import org.xml.sax.InputSource; 21 24 import org.xml.sax.SAXException; … … 141 144 return factory; 142 145 } 146 147 /** 148 * Get the first child element 149 * @param parent parent node 150 * @return the first child element 151 * @since 14348 152 */ 153 public static Element getFirstChildElement(Node parent) { 154 NodeList children = parent.getChildNodes(); 155 for (int i = 0; i < children.getLength(); i++) { 156 Node child = children.item(i); 157 if (child instanceof Element) { 158 return (Element) child; 159 } 160 } 161 return null; 162 } 143 163 }
Note:
See TracChangeset
for help on using the changeset viewer.