Example usage for org.dom4j.util NodeComparator compare

List of usage examples for org.dom4j.util NodeComparator compare

Introduction

In this page you can find the example usage for org.dom4j.util NodeComparator compare.

Prototype

public int compare(String o1, String o2) 

Source Link

Usage

From source file:com.globalsight.terminology.EntryUtils.java

License:Apache License

/**
 * Tests if two elements are equal. If the elements have simple
 * content they are compared as is (case-sensitive), otherwise the
 * comparison ignores case and embedded formatting.
 *//*  w w  w  . j a va 2 s  .c  o  m*/
static private boolean fieldEquals(Element p_one, Element p_two, NodeComparator p_comp) {
    if (p_comp.compare(p_one, p_two) == 0) {
        return true;
    }

    if (p_one.hasContent() || p_two.hasContent()) {
        String text1 = getInnerText(p_one);
        String text2 = getInnerText(p_two);

        if (text1.equalsIgnoreCase(text2)) {
            return true;
        }
    }

    return false;
}