Interface XMLAttributes

    • Method Detail

      • addAttribute

        int addAttribute​(QName attrName,
                         String attrType,
                         String attrValue)
        Adds an attribute. The attribute's non-normalized value of the attribute will have the same value as the attribute value until. Also, the added attribute will be marked as specified in the XML instance document unless set otherwise using the setSpecified method.

        Note: If an attribute of the same name already exists, the old values for the attribute are replaced by the new values.

        Parameters:
        attrName - The attribute name.
        attrType - The attribute type. The type name is determined by the type specified for this attribute in the DTD. For example: "CDATA", "ID", "NMTOKEN", etc. However, attributes of type enumeration will have the type value specified as the pipe ('|') separated list of the enumeration values prefixed by an open parenthesis and suffixed by a close parenthesis. For example: "(true|false)".
        attrValue - The attribute value.
        Returns:
        Returns the attribute index.
        See Also:
        setSpecified(int, boolean)
      • removeAllAttributes

        void removeAllAttributes()
        Removes all of the attributes. This method will also remove all entities associated to the attributes.
      • removeAttributeAt

        void removeAttributeAt​(int attrIndex)
        Removes the attribute at the specified index.

        Note: This operation changes the indexes of all attributes following the attribute at the specified index.

        Parameters:
        attrIndex - The attribute index.
      • setName

        void setName​(int attrIndex,
                     QName attrName)
        Sets the name of the attribute at the specified index.
        Parameters:
        attrIndex - The attribute index.
        attrName - The new attribute name.
      • getName

        void getName​(int attrIndex,
                     QName attrName)
        Gets the fields in the given QName structure with the values of the attribute name at the specified index.
        Parameters:
        attrIndex - The attribute index.
        attrName - The attribute name structure to fill in.
      • getName

        QName getName​(int attrIndex)
        Returns the QName structure of the name. Because QName is a modifiable data structure, make sure you know what you do when you take this shortcut route.
        Parameters:
        attrIndex - The attribute index.
      • setValue

        void setValue​(int attrIndex,
                      String attrValue)
        Sets the value of the attribute at the specified index. This method will overwrite the non-normalized value of the attribute.
        Parameters:
        attrIndex - The attribute index.
        attrValue - The new attribute value.
      • getNonNormalizedValue

        String getNonNormalizedValue​(int attrIndex)
        Parameters:
        attrIndex - The attribute index.
        Returns:
        the non-normalized value of the attribute at the specified index. If no non-normalized value is set, this method will return the same value as the getValue(int) method.
      • setSpecified

        void setSpecified​(int attrIndex,
                          boolean specified)
        Sets whether an attribute is specified in the instance document or not.
        Parameters:
        attrIndex - The attribute index.
        specified - True if the attribute is specified in the instance document.