Forum > General

Wrong Number of perimeters error

(1/1)

captian jaster:

--- Code: --- Procedure AddXMLParent(var XMLDoc:TXMLDocument;  const MakeElement:String;
AddAttr:String);
BEGIN
  Nodes.RootNode := XMLDoc.DocumentElement;
  Nodes.ParentNode := XMLDoc.CreateElement(MakeElement);
  TDOMElement(Nodes.ParentNode).SetAttribute(AddAttr);
  Nodes.RootNode.AppendChild(Nodes.ParentNode);
END;

--- End code ---


--- Code: ---Procedure AddXMLChild(var XMLDoc:TXMLDocument; const AddElement:String;
ChildText:String; AddAttr:String);
BEGIN
 Nodes.ParentNode := XMLDoc.CreateElement(AddElement);
 TDOMElement(Nodes.ParentNode).SetAttribute(AddAttr);
 Nodes.ChildNode := XMLDoc.CreateTextNode(ChildText);
 Nodes.ParentNode.AppendChild(Nodes.ChildNode);
 Nodes.RootNode.ChildNodes.Item[0].AppendChild(Nodes.ParentNode);
END;

--- End code ---

it says

--- Quote ---Wrong Number Of Perimeters called for SetAttribute
--- End quote ---
Whats Wrong?

paweld:
SetAttribute require two parameters: Name and Value

http://wiki.lazarus.freepascal.org/XML_Tutorial

Best regards
paweld

Navigation

[0] Message Index

Go to full version