function IsNodeHasAttributes(xNode: IXMLDOMNode; attributeName: WideString):
Boolean;
implementation
function ChildNodeByName(const xParentNode: IXMLDOMNode; nodeName: WideString):
IXMLDOMNode;
var
I: Integer;
xChildNode: IXMLDOMNode;
begin
Result := nil;
for I := 0 to xParentNode.childNodes.length - 1 do
begin
xChildNode := xParentNode.childNodes.item;
if SameText(xChildNode.nodeName, nodeName) then
begin
Result := xChildNode;
break;
end;
end;
end;
function GetNodeAttributeValue(xNode: IXMLDOMNode; attributeName: WideString):
WideString;
var
xAttribute: IXMLDOMNode;
begin
xAttribute := xNode.attributes.getNamedItem(attributeName);
Result := xAttribute.nodeValue;
end;
procedure SetNodeAttributeValue(xDoc: IXMLDOMDocument; xNode: IXMLDOMNode;
attributeName, attributeValue: WideString);
var
xAttribute: IXMLDOMNode;
begin
xAttribute := xNode.attributes.setNamedItem(xDoc.createAttribute(attributeName));
xAttribute.nodeValue := attributeValue;
end;
function IsNodeHasAttributes(xNode: IXMLDOMNode; attributeName: WideString):
Boolean;
var
xAttribute: IXMLDOMNode;
begin
xAttribute := xNode.attributes.getNamedItem(attributeName);
Result := xAttribute <> nil;
end;