< prev index next >

test/javax/xml/jaxp/unittest/stream/XMLStreamWriterTest/DOMUtil.java

Print this page




 204             }
 205         }
 206         return prefixDecl;
 207     }
 208 
 209     /**
 210      * Gets the first child of the given name, or null.
 211      */
 212     public static Element getFirstChild(Element e, String nsUri, String local) {
 213         for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
 214             if (n.getNodeType() == Node.ELEMENT_NODE) {
 215                 Element c = (Element) n;
 216                 if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri))
 217                     return c;
 218             }
 219         }
 220         return null;
 221     }
 222 
 223 }
 224 


 204             }
 205         }
 206         return prefixDecl;
 207     }
 208 
 209     /**
 210      * Gets the first child of the given name, or null.
 211      */
 212     public static Element getFirstChild(Element e, String nsUri, String local) {
 213         for (Node n = e.getFirstChild(); n != null; n = n.getNextSibling()) {
 214             if (n.getNodeType() == Node.ELEMENT_NODE) {
 215                 Element c = (Element) n;
 216                 if (c.getLocalName().equals(local) && c.getNamespaceURI().equals(nsUri))
 217                     return c;
 218             }
 219         }
 220         return null;
 221     }
 222 
 223 }

< prev index next >