xmlRemoveElementAttribute()
Removes the given attribute from its node.
Synopsis
int xmlRemoveElementAttribute(unsigned doc, unsigned node, string
attr);
Parameters
Parameter | Description |
---|---|
doc | The document ID returned by e.g. xmlNewDocument(). |
node | Node-ID |
attr | Attribute which value shall be removed. |
Return value
0 if the removing process was successful.
If an error occurs, -1 will be returned.
Description
Removes the given attribute from its node.
Example
This example creates a new document in memory and adds nodes to the document. It also sets an attribute and deletes it as well as sets a value for a node and prints the content of the document.
#uses "CtrlXml"
main()
{
int docNum = xmlNewDocument();
xmlAppendChild(docNum, -1, XML_COMMENT_NODE, "my fine new
comment");
int node = xmlAppendChild(docNum, -1, XML_ELEMENT_NODE, "first
element");
node = xmlAppendChild(docNum, node, XML_ELEMENT_NODE,
"sub_element");
xmlSetElementAttribute(docNum, node, "anAttribute", "a
value");
DebugN(xmlDocumentToString(docNum));
xmlRemoveElementAttribute(docNum, node, "anAttribute");
DebugN(xmlDocumentToString(docNum));
}
Assignment
Availability
CTRL. In every script where the "CtrlXml" extension (#uses "CtrlXml") is used.