/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttribute(String,String)}. */ public void setAttribute(String name, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } Attr attr = getAttributeNode(name); if (attr == null) { attr = getOwnerDocument().createAttribute(name); attr.setValue(value); attributes.setNamedItem(attr); } else { attr.setValue(value); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttribute(String,String)}. */ public void setAttribute(String name, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } Attr attr = getAttributeNode(name); if (attr == null) { attr = getOwnerDocument().createAttribute(name); attr.setValue(value); attributes.setNamedItem(attr); } else { attr.setValue(value); } }
/** * <b>DOM</b>: Implements {@link * org.w3c.dom.Element#setAttribute(String,String)}. */ public void setAttribute(String name, String value) throws DOMException { if (attributes == null) { attributes = createAttributes(); } Attr attr = getAttributeNode(name); if (attr == null) { attr = getOwnerDocument().createAttribute(name); attr.setValue(value); attributes.setNamedItem(attr); } else { attr.setValue(value); } }
/** * <b>DOM</b>: Implements * {@link org.w3c.dom.Element#setIdAttribute(String,boolean)}. */ public void setIdAttribute(String name, boolean isId) throws DOMException { AbstractAttr a = (AbstractAttr) getAttributeNode(name); if (a == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { name }); } if (a.isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { name }); } updateIdEntry(a, isId); a.isIdAttr = isId; }
/** * <b>DOM</b>: Implements * {@link org.w3c.dom.Element#setIdAttribute(String,boolean)}. */ public void setIdAttribute(String name, boolean isId) throws DOMException { AbstractAttr a = (AbstractAttr) getAttributeNode(name); if (a == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { name }); } if (a.isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { name }); } updateIdEntry(a, isId); a.isIdAttr = isId; }
/** * <b>DOM</b>: Implements * {@link org.w3c.dom.Element#setIdAttribute(String,boolean)}. */ public void setIdAttribute(String name, boolean isId) throws DOMException { AbstractAttr a = (AbstractAttr) getAttributeNode(name); if (a == null) { throw createDOMException(DOMException.NOT_FOUND_ERR, "attribute.missing", new Object[] { name }); } if (a.isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { name }); } updateIdEntry(a, isId); a.isIdAttr = isId; }