Here you can find the source of getNextNodeSibling(Node node)
Parameter | Description |
---|---|
node | org.w3c.dom.Node The node |
public static Node getNextNodeSibling(Node node)
//package com.java2s; /******************************************************************************* * Copyright (c) 2003, 2006 IBM Corporation and others. * 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:/*from ww w . ja va 2 s . c o m*/ * IBM Corporation - initial API and implementation *******************************************************************************/ import org.w3c.dom.Node; public class Main { /** * Get the next non-text sibling after a node. * * @return org.w3c.dom.Node The first non-text sibling node after * @node. If there is no next non-text sibling, null is returned. * @param node * org.w3c.dom.Node The node */ public static Node getNextNodeSibling(Node node) { Node sibling = node.getNextSibling(); while (sibling != null && sibling.getNodeType() != Node.ELEMENT_NODE) sibling = sibling.getNextSibling(); return sibling; } }