Recent

Author Topic: Wrong Number of perimeters error  (Read 3164 times)

captian jaster

  • Guest
Wrong Number of perimeters error
« on: April 16, 2010, 03:31:50 pm »
Code: [Select]
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;

Code: [Select]
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;

it says
Quote
Wrong Number Of Perimeters called for SetAttribute
Whats Wrong?

paweld

  • Hero Member
  • *****
  • Posts: 547
Re: Wrong Number of perimeters error
« Reply #1 on: April 16, 2010, 05:24:59 pm »
SetAttribute require two parameters: Name and Value

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

Best regards
paweld
Best regards / Pozdrawiam
paweld

 

TinyPortal © 2005-2018