The SET ATTRIBUTE procedure is used to set an attribute for a DOM element. If the attribute does not exist, it is added; if the attribute already exists, its value is updated.
Applicability
This content applies only to OceanBase Database Enterprise Edition. OceanBase Database Community Edition provides only the MySQL-compatible mode.
Note
For V4.4.2, this subprogram is available starting with OceanBase Database V4.4.2 BP3.
Syntax
DBMS_XMLDOM.setAttribute (
elem IN DBMS_XMLDOM.DOMELEMENT,
name IN VARCHAR2,
value IN VARCHAR2);
Parameters
Parameters |
Explanation |
|---|---|
| elem | TargetDBMS_XMLDOM.DOMELEMENTHandle. |
| name | Attribute name. |
| value | Attribute value. |
Return value
No return value.
Usage instructions
If you perform this procedure on an existing attribute with the same name, the original value will be overwritten.
Examples
DECLARE
doc DBMS_XMLDOM.DOMDOCUMENT;
elem DBMS_XMLDOM.DOMELEMENT;
BEGIN
doc := DBMS_XMLDOM.newDOMDocument;
elem := DBMS_XMLDOM.createElement(doc, 'item');
DBMS_XMLDOM.setAttribute(elem, 'id', '1001');
DBMS_XMLDOM.freeDocument(doc);
END;
/
