Support data structures where link metadata is stored in mutliple HTML5 data-* attributes.
@param resourceProps ValueMap to write link metadata to
@param element Link element
@return true if any metadata attribute was found
972831
private boolean getAnchorMetadataFromData(ValueMap resourceProps, Element element) {
    boolean foundAny = false;

    List<Attribute> attributes = element.getAttributes();
    for (Attribute attribute : attributes) {
      if (DataPropertyUtil.isHtml5DataName(attribute.getName())) {
        String value = attribute.getValue();
        if (StringUtils.isNotEmpty(value)) {
          String property = DataPropertyUtil.toHeadlessCamelCaseName(attribute.getName());
          if (StringUtils.startsWith(value, "[") && StringUtils.endsWith(value, "]")) {
            try {
              JSONArray jsonArray = new JSONArray(value);
              String[] values = new String[jsonArray.length()];
              for (int i = 0; i < jsonArray.length(); i++) {
                values[i] = jsonArray.optString(i);
              }
              resourceProps.put(property, values);
            }
            catch (JSONException ex) {
              // ignore
            }
          }
          else {
            // decode if required
            value = decodeIfEncoded(value);
            resourceProps.put(property, value);
          }
          foundAny = true;
        }
      }
    }

    return foundAny;
  }
789574
public boolean isRdfResource(final Graph graph,
                                 final Node subject,
                                 final String namespace,
                                 final String resource) {
        LOGGER.trace("Is RDF Resource? s:{}, ns:{}, r:{}, g:{}", subject, namespace, resource, graph);
        return graph.find(subject, type.asNode(),
                createResource(namespace + resource).asNode()).hasNext();
    }
577300
private List<Resource> resourcesOf(JsonNode resourceNodes) {
        List<Resource> resources = new LinkedList<Resource>();

        if (resourceNodes.isArray()) {
            for (JsonNode resource : resourceNodes) {
                resources.add(new Resource(resource.asText()));
            }
        } else {
            resources.add(new Resource(resourceNodes.asText()));
        }

        return resources;
    }
1226238
function (event) {
      if (!_emberViewsSystemUtils.isSimpleClick(event)) {
        return true;
      }

      var preventDefault = _emberMetalProperty_get.get(this, 'preventDefault');
      var targetAttribute = _emberMetalProperty_get.get(this, 'target');

      if (preventDefault !== false) {
        if (!targetAttribute || targetAttribute === '_self') {
          event.preventDefault();
        }
      }

      if (_emberMetalProperty_get.get(this, 'bubbles') === false) {
        event.stopPropagation();
      }

      if (_emberMetalProperty_get.get(this, '_isDisabled')) {
        return false;
      }

      if (_emberMetalProperty_get.get(this, 'loading')) {
        _emberMetalLogger.default.warn('This link-to is in an inactive loading state because at least one of its parameters presently has a null/undefined value, or the provided route name is invalid.');
        return false;
      }

      if (targetAttribute && targetAttribute !== '_self') {
        return false;
      }

      var routing = _emberMetalProperty_get.get(this, '_routing');
      var qualifiedRouteName = _emberMetalProperty_get.get(this, 'qualifiedRouteName');
      var models = _emberMetalProperty_get.get(this, 'models');
      var queryParamValues = _emberMetalProperty_get.get(this, 'queryParams.values');
      var shouldReplace = _emberMetalProperty_get.get(this, 'replace');

      routing.transitionTo(qualifiedRouteName, models, queryParamValues, shouldReplace);
    }
76541
@Override
    public void link(NGScope scope, JQElement element, JSON attrs) {
        ImageResource resource = scope.get(getName());
        if (resource == null) {
            LOG.log(Level.WARNING, "Mandatory attribute " + getName() + " value is mssing");
            return;
        }
        Image image = new Image(resource);
        Element target = image.asWidget().getElement();
        String className = element.attr("class");
        target.addClassName(className);
        String style = element.attr("style");
        target.setAttribute("style", style);
        element.replaceWith(target);
    }
1059164
private void relink(DOMOutputElement parent, Element element)
    {
        super.relink(parent);
        mParent = parent;
        mElement = element;
        parent.appendNode(element);
        mDefaultNsSet = false;
    }
208719
protected void setNodeAttributes(Object node, Map attributes) {
        // set the properties
        //noinspection unchecked
        for (Map.Entry entry : (Set<Map.Entry>) attributes.entrySet()) {
            String property = entry.getKey().toString();
            Object value = entry.getValue();
            InvokerHelper.setProperty(node, property, value);
        }
    }
403849
private static Attributes toAttributesProto(
      io.opencensus.trace.export.SpanData.Attributes attributes,
      Map<String, AttributeValue> resourceLabels,
      Map<String, AttributeValue> fixedAttributes) {
    Attributes.Builder attributesBuilder =
        toAttributesBuilderProto(
            attributes.getAttributeMap(), attributes.getDroppedAttributesCount());
    attributesBuilder.putAttributeMap(AGENT_LABEL_KEY, AGENT_LABEL_VALUE);
    for (Entry<String, AttributeValue> entry : resourceLabels.entrySet()) {
      attributesBuilder.putAttributeMap(entry.getKey(), entry.getValue());
    }
    for (Entry<String, AttributeValue> entry : fixedAttributes.entrySet()) {
      attributesBuilder.putAttributeMap(entry.getKey(), entry.getValue());
    }
    return attributesBuilder.build();
  }
631813
public void setIdAttributeNS(String namespaceURI, String localName, boolean isId) throws DOMException {
	// dynamic load to support jre 1.4 and 1.5
	try {
	    Method m = element.getClass().getMethod("setIdAttributeNS", new Class[] { namespaceURI.getClass(), localName.getClass(), boolean.class });
	    m.invoke(element, new Object[] { namespaceURI, localName, Caster.toBoolean(isId) });
	}
	catch (Exception e) {
	    throw new PageRuntimeException(Caster.toPageException(e));
	}
    }
235380
public boolean containsAttribute(XmlElement xe,String key, String value){
		if(xe.getAttributes() != null){
			for(Attribute attribute : xe.getAttributes()){
				if(attribute.getName().equalsIgnoreCase(key) && attribute.getValue().equalsIgnoreCase(value)){
					return true;
				}
			}
		}
		return false;
	}
469246
public static String getAttributeValue(final Node elementNode, final String attrName, final String defValue)
    {
        final Node attrNode = elementNode.getAttributes().getNamedItemNS(null, attrName);

        if (attrNode == null)
        {
            return defValue;
        }

        return attrNode.getNodeValue();
    }
1046618
function Link (rel, value) {
    if (!(this instanceof Link)) {
      return new Link(rel, value);
    }

    if (!rel) throw new Error('Required <link> attribute "rel"');

    this.rel = rel;

    if (typeof value === 'object') {

      // If value is a hashmap, just copy properties
      if (!value.href) throw new Error('Required <link> attribute "href"');
      var expectedAttributes = ['rel', 'href', 'name', 'hreflang', 'title', 'templated', 'icon', 'align', 'method'];
      for (var attr in value) {
        if (value.hasOwnProperty(attr)) {
          if (!~expectedAttributes.indexOf(attr)) {
            // Unexpected attribute: ignore it
            continue;
          }
          this[attr] = value[attr];
        }
      }

    } else {

      // value is a scalar: use its value as href
      if (!value) throw new Error('Required <link> attribute "href"');
      this.href = String(value);

    }
  }
216692
public static void writeResources(Element node, XMLResources resources, XMLBuilder builder) {
		if (resources != null) {
			final Element resourcesNode = builder.createElement(NODE_RESOURCES);
			for (final java.util.Map.Entry<Long, Entry> pair : resources.getPairs().entrySet()) {
				final Entry e = pair.getValue();
				if (e.isURL()) {
					final Element resourceNode = builder.createElement(NODE_RESOURCE);
					resourceNode.setAttribute(ATTR_ID, XMLResources.getStringIdentifier(pair.getKey()));
					resourceNode.setAttribute(ATTR_URL, e.getURL().toExternalForm());
					resourceNode.setAttribute(ATTR_MIMETYPE, e.getMimeType());
					resourcesNode.appendChild(resourceNode);
				} else if (e.isFile()) {
					final Element resourceNode = builder.createElement(NODE_RESOURCE);
					resourceNode.setAttribute(ATTR_ID, XMLResources.getStringIdentifier(pair.getKey()));
					final File file = e.getFile();
					final StringBuilder url = new StringBuilder();
					url.append("file:"); //$NON-NLS-1$
					boolean addSlash = false;
					for (final String elt : FileSystem.split(file)) {
						try {
							if (addSlash) {
								url.append("/"); //$NON-NLS-1$
							}
							url.append(URLEncoder.encode(elt, Charset.defaultCharset().name()));
						} catch (UnsupportedEncodingException e1) {
							throw new Error(e1);
						}
						addSlash = true;
					}
					resourceNode.setAttribute(ATTR_FILE, url.toString());
					resourceNode.setAttribute(ATTR_MIMETYPE, e.getMimeType());
					resourcesNode.appendChild(resourceNode);
				} else if (e.isEmbeddedData()) {
					final Element resourceNode = builder.createElement(NODE_RESOURCE);
					resourceNode.setAttribute(ATTR_ID, XMLResources.getStringIdentifier(pair.getKey()));
					resourceNode.setAttribute(ATTR_MIMETYPE, e.getMimeType());
					final byte[] data = e.getEmbeddedData();
					final CDATASection cdata = builder.createCDATASection(toString(data));
					resourceNode.appendChild(cdata);
					resourcesNode.appendChild(resourceNode);
				}
			}
			if (resourcesNode.getChildNodes().getLength() > 0) {
				node.appendChild(resourcesNode);
			}
		}
	}
612153
public void setFile(Element el, String key, Resource value) {
	if (value != null && value.toString().length() > 0) el.setAttribute(key, value.getAbsolutePath());
    }
112330
public boolean hasAttributeNS(String namespaceURI, String localName)
  {
    return DTM.NULL != dtm.getAttributeNode(node,namespaceURI,localName);
  }
4595
public static boolean isTrueFromAttribute(AttributeSet attrs, String attribute, boolean defaultValue) {
        return attrs.getAttributeBooleanValue(Ui.androidStyleNameSpace, attribute, defaultValue);
    }
376393
private boolean getBooleanAttributeValue(Node source) {
        Attr attribute = (Attr)source;
        String value = attribute.getValue();
        return "true".equalsIgnoreCase(value);
    }