Java XML Node Name getBeanElement(Node elem, String nodeName)

Here you can find the source of getBeanElement(Node elem, String nodeName)

Description

get Bean Element

License

Open Source License

Declaration

private static Node getBeanElement(Node elem, String nodeName) 

Method Source Code

//package com.java2s;
/*******************************************************************************
 * Copyright (c) 2006, 2009 Spring IDE Developers
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors://  w  ww  .  j a v a 2s.  c  om
 *     Spring IDE Developers - initial API and implementation
 *******************************************************************************/

import org.w3c.dom.Node;

public class Main {
    private static Node getBeanElement(Node elem, String nodeName) {
        if (!nodeName.equals(elem.getLocalName()) && !elem.getOwnerDocument().equals(elem.getParentNode())) {
            return getBeanElement(elem.getParentNode(), nodeName);
        } else {
            return elem;
        }
    }
}

Related

  1. getAllNodes(Node node, String[] nodeNamesArray)
  2. getDescendent(Node node, String nodeName)
  3. getIntegerNodeValue(Node node, String nodeName)
  4. getName(Node node)
  5. getName(Node node)