Package com.btaz.util.xml.model

Examples of com.btaz.util.xml.model.Element


            String textB = ((Content)b).getText();
            if(! textA.equals(textB)) {
                return new Difference(a, b, "Content is different");
            }
        } else if (a instanceof Element && b instanceof Element) {
            Element ea = (Element)a;
            Element eb = (Element)b;

            // - element name
            if(! ea.getName().equals(eb.getName())) {
                return new Difference(a, b, "Element names are different");
            }

            // - attributes names
            if(! ea.getAttributeNames().equals(eb.getAttributeNames())) {
                return new Difference(a, b, "Element attribute names are different");
            }

            // - attributes values
            for(int i=0; i<ea.getAttributeNames().size(); i++) {
                if(! ea.attributeValue(ea.getAttributeNames().get(i))
                        .equals(eb.attributeValue(eb.getAttributeNames().get(i)))) {
                    return new Difference(a, b, "Element attribute values are different");
                }
            }

            // - element type
            if(ea.isEmptyElementTag() != eb.isEmptyElementTag()) {
                return new Difference(a, b, "Empty element tags are different");
            }
        } else {
            return new Difference(a, b, "The nodes are different");
        }
View Full Code Here

TOP

Related Classes of com.btaz.util.xml.model.Element

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.