src/main/java/org/jsoup/helper/W3CDom.java
/**
         * Finds any namespaces defined in this element. Returns any tag prefix.
         */
Finds any namespaces defined in this element. Returns any tag prefix.
Finds any namespaces defined in this element . Returns any tag prefix .
private String updateNamespaces(org.jsoup.nodes.Element el) {
            Attributes attributes = el.attributes();
            for (Attribute attr : attributes) {
                String key = attr.getKey();
                String prefix;
                if (key.equals(xmlnsKey)) {
                    prefix = "";
                } else if (key.startsWith(xmlnsPrefix)) {
                    prefix = key.substring(xmlnsPrefix.length());
                } else {
                    continue;
                }
                namespacesStack.peek().put(prefix, attr.getValue());
            }
            int pos = el.tagName().indexOf(':');
            return pos > 0 ? el.tagName().substring(0, pos) : "";
        }
private String updateNamespaces ( org . jsoup . nodes . Element el ) { Attributes attributes = el . attributes ( ) ; for ( Attribute attr : attributes ) { String key = attr . getKey ( ) ; String prefix ; if ( key . equals ( xmlnsKey ) ) { prefix = "" ; } else if ( key . startsWith ( xmlnsPrefix ) ) { prefix = key . substring ( xmlnsPrefix . length ( ) ) ; } else { continue ; } namespacesStack . peek ( ) . put ( prefix , attr . getValue ( ) ) ; } int pos = el . tagName ( ) . indexOf ( ':' ) ; return pos > 0 ? el . tagName ( ) . substring ( 0 , pos ) : "" ; }
Finds any namespaces defined in this element.
Finds any namespaces defined in this element .
// scan the element for namespace declarations // like: xmlns="blah" or xmlns:prefix="blah" // get the element prefix if any