Java XML First Child Element getFirstChildElement(Node node)

Here you can find the source of getFirstChildElement(Node node)

Description

get First Child Element

License

Open Source License

Declaration

public static Node getFirstChildElement(Node node) 

Method Source Code

//package com.java2s;
// License as published by the Free Software Foundation; either

import org.w3c.dom.Node;

public class Main {
    public static Node getFirstChildElement(Node node) {
        Node firstChildElement = null;
        for (Node child = node.getFirstChild(); child != null; child = child.getNextSibling()) {
            if (child.getNodeType() != Node.TEXT_NODE) {
                firstChildElement = child;
                break;
            }/*from ww  w  .  ja  va2s.co  m*/
        }

        return firstChildElement;
    }
}

Related

  1. getFirstChildElement(Node n)
  2. getFirstChildElement(Node n, String ns, String localName)
  3. getFirstChildElement(Node node)
  4. getFirstChildElement(Node node)
  5. getFirstChildElement(Node node)
  6. getFirstChildElement(Node node)
  7. getFirstChildElement(Node node)
  8. getFirstChildElement(Node node)
  9. getFirstChildElement(Node node)