Java XML Node Previous getPreviousTypedNode(Node node, short nodeType)

Here you can find the source of getPreviousTypedNode(Node node, short nodeType)

Description

get Previous Typed Node

License

Open Source License

Declaration

private static Node getPreviousTypedNode(Node node, short nodeType) 

Method Source Code

//package com.java2s;

import org.w3c.dom.*;

public class Main {
    private static Node getPreviousTypedNode(Node node, short nodeType) {
        node = node.getPreviousSibling();

        while (node != null && node.getNodeType() != nodeType) {
            node = node.getPreviousSibling();
        }/*from ww w.j av  a  2  s.co m*/

        return node;
    }

    private static short getNodeType(Node node) {
        return (node != null ? node.getNodeType() : -1);
    }
}

Related

  1. getPreviousComment(Node element)
  2. getPreviousElementNode(Node node)
  3. getPreviousNodeByName(Node currentNode, String tagName)
  4. getPreviousTypedNode(Node node, short nodeType)
  5. getPreviousTypedNode(Node node, short nodeType)