Returns the URI of an element (DOM flavor)

@param elem
the element that holds the location information
@return the element's URI or "<code>[unknown location]</code>" if
<code>elem</code> has no location information.
483361
public static String getURI(Element elem) {
		Attr attr = elem.getAttributeNodeNS(URI, SRC_ATTR);
		return attr != null ? attr.getValue() : LocationUtils.UNKNOWN_STRING;
	}
534175
function( elem, name, isXML ) {
			var ret;
			return isXML ?
				undefined :
				(ret = elem.getAttributeNode( name )) && ret.value !== "" ?
					ret.value :
					null;
		}
653959
def namespace_uri(self, name):
        
        a_node = self.adapter.get_node_attribute_node(self.impl_element, name)
        if a_node is None:
            return None
        return self.adapter.get_node_namespace_uri(a_node)
388058
public static int getColumn(Element elem) {
		Attr attr = elem.getAttributeNodeNS(URI, COL_ATTR);
		return attr != null ? Integer.parseInt(attr.getValue()) : -1;
	}
46275
function elem(tagName) {
    if (!utils.isString(tagName)) {
        return null;
    }

    // element at the very least has name and fn to render itself
    var e = {
        tag: tagName
    };

    // add other values to the element based on the input argument
    if (arguments.length > 1) {
        for (var i = 1, len = arguments.length; i < len; ++i) {
            var arg = arguments[i];

            if (utils.isArray(arg)) {
                if (e.children && e.children.length) {
                    e.children = e.children.concat(arg);
                }
                else {
                    e.children = arg;
                }
            }
            else if (utils.isObject(arg) && arg.hasOwnProperty('tag')) {
                e.children = e.children || [];
                e.children.push(arg);
            }
            else if (utils.isObject(arg) && arg.tag && arg.toString) {
                e.children = [arg];
            }
            else if (utils.isObject(arg)) {
                e.attributes = arg;
            }
            else if (utils.isString(arg)) {
                e.text = arg;
            }
        }
    }

    return e;
}
412727
@Override
    public String getURI(int index) {
        if (index < 0 || index >= attributesList.size()) {
            return null;
        }
        return attributesList.get(index).nameSpace;
    }
372860
public static List<Element> getChildElements(final Element elem, final DitaClass cls, final boolean deep) {
        final NodeList children = deep ? elem.getElementsByTagName("*") : elem.getChildNodes();
        final List<Element> res = new ArrayList<>(children.getLength());
        for (int i = 0; i < children.getLength(); i++) {
            final Node child = children.item(i);
            if (cls.matches(child)) {
                res.add((Element) child);
            }
        }
        return res;
    }
532151
def parse_local(elem)
    ParseRegexp =~ elem
    if $2
      ns = @tag2ns[$1]
      name = $2
      if !ns
	raise FormatError.new("unknown namespace qualifier: #{$1}")
      end
    elsif $1
      ns = nil
      name = $1
    else
      raise FormatError.new("illegal element format: #{elem}")
    end
    XSD::QName.new(ns, name)
  end
378242
public static int getXPathLocation(String dom, String xpath) {
		String dom_lower = dom.toLowerCase();
		String xpath_lower = xpath.toLowerCase();
		String[] elements = xpath_lower.split("/");
		int pos = 0;
		int temp;
		int number;
		for (String element : elements) {
			if (!element.isEmpty() && !element.startsWith("@") && !element.contains("()")) {
				if (element.contains("[")) {
					try {
						number =
								Integer.parseInt(element.substring(element.indexOf("[") + 1,
										element.indexOf("]")));
					} catch (NumberFormatException e) {
						return -1;
					}
				} else {
					number = 1;
				}
				for (int i = 0; i < number; i++) {
					// find new open element
					temp = dom_lower.indexOf("<" + stripEndSquareBrackets(element), pos);

					if (temp > -1) {
						pos = temp + 1;

						// if depth>1 then goto end of current element
						if (number > 1 && i < number - 1) {
							pos =
									getCloseElementLocation(dom_lower, pos,
											stripEndSquareBrackets(element));
						}

					}
				}
			}
		}
		return pos - 1;
	}
826
function getLinked(elem, attr) {
		var str = elem.getAttribute(attr);
		if(!str) {return null;}
		var m = str.match(/\(\#(.*)\)/);
		if(!m || m.length !== 2) {
			return null;
		}
		return S.getElem(m[1]);
	}
1228555
public E find(E e) {
	Node<E> node = elmap.get(e);
	if(node == null) return e;
	return _find_root(node).element;
    }
885340
function (elem)
    {
        if (!elem) { return null; }

        var str = "";
        if (elem.childNodes.length === 0 && elem.nodeType ==
            Strophe.ElementType.TEXT) {
            str += elem.nodeValue;
        }

        for (var i = 0; i < elem.childNodes.length; i++) {
            if (elem.childNodes[i].nodeType == Strophe.ElementType.TEXT) {
                str += elem.childNodes[i].nodeValue;
            }
        }

        return Strophe.xmlescape(str);
    }
1128220
public static String getCascadeValue(final Element elem, final String attrName) {
        Element current = elem;
        while (current != null) {
            final Attr attr = current.getAttributeNode(attrName);
            if (attr != null) {
                return attr.getValue();
            }
            final Node parent = current.getParentNode();
            if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
                current = (Element) parent;
            } else {
                break;
            }
        }
        return null;
    }
725485
static public String toResourceUri(FacesContext facesContext, Object o)
    {
        if (o == null)
        {
            return null;
        }

        String uri = o.toString();

        // *** EL Coercion problem ***
        // If icon or image attribute was declared with #{resource[]} and that expression
        // evaluates to null (it means ResourceHandler.createResource returns null because 
        // requested resource does not exist)
        // EL implementation turns null into ""
        // see http://www.irian.at/blog/blogid/unifiedElCoercion/#unifiedElCoercion
        if (uri.length() == 0)
        {
            return null;
        }

        // With JSF 2.0 url for resources can be done with EL like #{resource['resourcename']}
        // and such EL after evalution contains context path for the current web application already,
        // -> we dont want call viewHandler.getResourceURL()
        if (uri.contains(ResourceHandler.RESOURCE_IDENTIFIER))
        {
            return uri;
        }

        // Treat two slashes as server-relative
        if (uri.startsWith("//"))
        {
            return uri.substring(1);
        }
        else
        {
            // If the specified path starts with a "/",
            // following method will prefix it with the context path for the current web application,
            // and return the result
            String resourceURL = facesContext.getApplication().getViewHandler()
                    .getResourceURL(facesContext, uri);
            return facesContext.getExternalContext().encodeResourceURL(
                    resourceURL);
        }
    }
1091415
public static int getLine(Element elem) {
		Attr attr = elem.getAttributeNodeNS(URI, LINE_ATTR);
		return attr != null ? Integer.parseInt(attr.getValue()) : -1;
	}
1143135
private static URL findBaseURI(final Element root) {
        URL baseURI = null;
        final List<Element> linksList = root.getChildren("link", OS_NS);
        if (linksList != null) {
            for (final Element element : linksList) {
                final Element link = element;
                if (!root.equals(link.getParent())) {
                    break;
                }
                String href = link.getAttribute("href").getValue();
                if (link.getAttribute("rel", OS_NS) == null || link.getAttribute("rel", OS_NS).getValue().equals("alternate")) {
                    href = resolveURI(null, link, href);
                    try {
                        baseURI = new URL(href);
                        break;
                    } catch (final MalformedURLException e) {
                        System.err.println("Base URI is malformed: " + href);
                    }
                }
            }
        }
        return baseURI;
    }
319933
private String getURI(Map<String, Object> props) {
        if (props == null)
            return null;
        if (props.keySet().contains(URI)) {
            return (props.get(URI).toString());
        } else {
            return null;
        }
    }