XML.RemoveAttribute

XML.RemoveAttribute ( 

string XMLPath,

string AttributeName )

Example 1

-- This example assumes the sample XML is already loaded into memory.

-- Return the currently loaded XML in a string.
strXML = XML.GetXML();
    
if (strXML ~= "") then
    Dialog.Message("Original XML contents",strXML);
end

-- Removes the "product" attribute from the first customer.
XML.RemoveAttribute("database/customer", "product");

-- See if any errors occurred. If no errors occurred, display the string.
error = Application.GetLastError();
if (error == 0) then
    -- Return the currently loaded(modified) XML in a string.
    strXML = XML.GetXML();
    if (strXML ~= "") then
        Dialog.Message("Modified XML contents",strXML);
    end
else
    Dialog.Message("Error", _tblErrorMessages[error]);
end

Gets the contents of the currently loaded XML as a string and first shows it in a dialog message. The "product" attribute is then removed from the first customer and the new XML is then shown in a dialog message.

See also:  Related Actions