/** * Add attributes from specified map to the specified tag. * If some attribute already exist it is preserved. * @param tag * @param attributes */ private void addAttributesToTag(TagNode tag, Map<String, String> attributes) { if (attributes != null) { Map<String, String> tagAttributes = tag.getAttributes(); for(Map.Entry< String, String > currEntry : attributes.entrySet()) { String attName = currEntry.getKey(); if ( !tagAttributes.containsKey(attName) ) { String attValue = currEntry.getValue(); tag.addAttribute(attName, attValue); } } } }
/** * Add attributes from specified map to the specified tag. * If some attribute already exist it is preserved. * * @param tag * @param attributes */ private void addAttributesToTag(TagNode tag, Map<String, String> attributes) { if (attributes != null) { Map<String, String> tagAttributes = tag.getAttributes(); for (Map.Entry<String, String> currEntry : attributes.entrySet()) { String attName = currEntry.getKey(); if (!tagAttributes.containsKey(attName)) { String attValue = currEntry.getValue(); tag.addAttribute(attName, attValue); } } } }
private void setAttribute(TagNode tagNode, String attrName, String attrValue) { if (tagNode.hasAttribute(attrName)) { tagNode.removeAttribute(attrName); } tagNode.addAttribute(attrName, attrValue); }
@Override public void addAttribute(final String name, final String value) { if (tagNode.hasAttribute(name)) { tagNode.removeAttribute(name); } tagNode.addAttribute(name, value); }
tag.addAttribute(linkAttrName, rewrittenLink);
cleanTimeValues.rootNode.addAttribute(xmlnsAtt, prefix);
cleanTimeValues.rootNode.addAttribute(xmlnsAtt, prefix);