Code example for Attr

Methods: getName, getNamespaceURI

0
            = "/home/dalvik-prebuild/OASIS/XSLT-Conformance-TC/TESTS/catalog.xml"; 
 
    /** Orders element attributes by optional URI and name. */ 
    private static final Comparator<Attr> orderByName = new Comparator<Attr>() {
        public int compare(Attr a, Attr b) { 
            int result = compareNullsFirst(a.getNamespaceURI(), b.getNamespaceURI()); 
            return result == 0 ? result 
                    : compareNullsFirst(a.getName(), b.getName()); 
        } 
 
        <T extends Comparable<T>> int compareNullsFirst(T a, T b) { 
            return (a == b) ? 0 
                    : (a == null) ? -1 
                    : (b == null) ? 1 
                    : a.compareTo(b); 
        } 
    }; 
 
    private final DocumentBuilder documentBuilder;
    private final TransformerFactory transformerFactory;
    private final XmlPullParserFactory xmlPullParserFactory;