/** * Sets the value of the attribute specified by namespace and qualified name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name (prefix:local) of the attribute * @param attributeValue the value of the attribute * @param notifyAttributeChangeListeners to notify the associated {@link HtmlAttributeChangeListener}s * @param notifyMutationObservers to notify {@code MutationObserver}s or not */ protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { final String value = attributeValue; final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value, true); newAttr.setParentNode(this); attributes_.put(qualifiedName, newAttr); if (namespaceURI != null) { namespaces_.put(namespaceURI, newAttr.getPrefix()); } }
/** * Creates an instance of a DOM element that can have a namespace. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or * {@code null}. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page); if (attributes != null && !attributes.isEmpty()) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes); for (final DomAttr entry : attributes_.values()) { entry.setParentNode(this); final String attrNamespaceURI = entry.getNamespaceURI(); if (attrNamespaceURI != null) { namespaces_.put(attrNamespaceURI, entry.getPrefix()); } } } }
/** * Creates an instance of a DOM element that can have a namespace. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or * <code>null</code>. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page); if (attributes != null && !attributes.isEmpty()) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes); for (final DomAttr entry : attributes_.values()) { entry.setParentNode(this); final String attrNamespaceURI = entry.getNamespaceURI(); if (attrNamespaceURI != null) { namespaces_.put(attrNamespaceURI, entry.getPrefix()); } } } }
/** * Creates an instance of a DOM element that can have a namespace. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or * <code>null</code>. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page); if (attributes != null && !attributes.isEmpty()) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes); for (final DomAttr entry : attributes_.values()) { entry.setParentNode(this); final String attrNamespaceURI = entry.getNamespaceURI(); if (attrNamespaceURI != null) { namespaces_.put(attrNamespaceURI, entry.getPrefix()); } } } }
/** * Sets the value of the attribute specified by namespace and qualified name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name (prefix:local) of the attribute * @param attributeValue the value of the attribute * @param notifyAttributeChangeListeners to notify the associated {@link HtmlAttributeChangeListener}s * @param notifyMutationObservers to notify {@code MutationObserver}s or not */ protected void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue, final boolean notifyAttributeChangeListeners, final boolean notifyMutationObservers) { final String value = attributeValue; final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value, true); newAttr.setParentNode(this); attributes_.put(qualifiedName, newAttr); if (namespaceURI != null) { namespaces_.put(namespaceURI, newAttr.getPrefix()); } }
/** * Creates an instance of a DOM element that can have a namespace. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or * {@code null}. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page); if (attributes != null && !attributes.isEmpty()) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes); for (final DomAttr entry : attributes_.values()) { entry.setParentNode(this); final String attrNamespaceURI = entry.getNamespaceURI(); if (attrNamespaceURI != null) { namespaces_.put(attrNamespaceURI, entry.getPrefix()); } } } }
/** * Creates an instance of a DOM element that can have a namespace. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name of the element type to instantiate * @param page the page that contains this element * @param attributes a map ready initialized with the attributes for this element, or * <code>null</code>. The map will be stored as is, not copied. */ public DomElement(final String namespaceURI, final String qualifiedName, final SgmlPage page, final Map<String, DomAttr> attributes) { super(namespaceURI, qualifiedName, page); if (attributes != null && !attributes.isEmpty()) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive(), attributes); for (final DomAttr entry : attributes_.values()) { entry.setParentNode(this); final String attrNamespaceURI = entry.getNamespaceURI(); if (attrNamespaceURI != null) { namespaces_.put(attrNamespaceURI, entry.getPrefix()); } } } }
/** * Sets the value of the attribute specified by namespace and qualified name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name (prefix:local) of the attribute * @param attributeValue the value of the attribute */ public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { final String value = attributeValue; if (attributes_ == NamedAttrNodeMapImpl.EMPTY_MAP) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive()); } final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value); newAttr.setParentNode(this); attributes_.put(qualifiedName, newAttr); if (namespaceURI != null) { namespaces().put(namespaceURI, newAttr.getPrefix()); } }
/** * Sets the value of the attribute specified by namespace and qualified name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name (prefix:local) of the attribute * @param attributeValue the value of the attribute */ public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { final String value = attributeValue; if (attributes_ == NamedAttrNodeMapImpl.EMPTY_MAP) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive()); } final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value); newAttr.setParentNode(this); attributes_.put(qualifiedName, newAttr); if (namespaceURI != null) { namespaces().put(namespaceURI, newAttr.getPrefix()); } }
/** * Sets the value of the attribute specified by namespace and qualified name. * * @param namespaceURI the URI that identifies an XML namespace * @param qualifiedName the qualified name (prefix:local) of the attribute * @param attributeValue the value of the attribute */ public void setAttributeNS(final String namespaceURI, final String qualifiedName, final String attributeValue) { final String value = attributeValue; if (attributes_ == NamedAttrNodeMapImpl.EMPTY_MAP) { attributes_ = new NamedAttrNodeMapImpl(this, isAttributeCaseSensitive()); } final DomAttr newAttr = new DomAttr(getPage(), namespaceURI, qualifiedName, value); newAttr.setParentNode(this); attributes_.put(qualifiedName, newAttr); if (namespaceURI != null) { namespaces().put(namespaceURI, newAttr.getPrefix()); } }