var PassNode: TDOMNode; Doc: TXMLDocument; begin Doc := TXMLDocument.Create; // Read in xml file from disk ReadXMLFile(Doc, '1.xml'); // Retrieve the "password" node PassNode := Doc.DocumentElement.FindNode('password'); // Write out value of the selected node WriteLn(PassNode.NodeValue); // will be blank // The text of the node is actually a separate child node WriteLn(PassNode.FirstChild.NodeValue); // correctly prints "abc"
1.pas(2,12) Error: Identifier not found "TDOMNode" 1.pas(2,20) Error: Error in type definition 1.pas(3,12) Error: Identifier not found "TXMLDocument" 1.pas(3,24) Error: Error in type definition 1.pas(5,9) Error: Identifier not found "TXMLDocument" 1.pas(7,2) Error: Identifier not found "ReadXMLFile" 1.pas(7,27) Error: Illegal expression 1.pas(9,18) Error: Illegal qualifier 1.pas(9,42) Fatal: Syntax error, ";" expected but "(" found 1.pas(9,42) Fatal: Compilation aborted
http://wiki.lazarus.freepascal.org/Networking писал(а):Currently there is a set of units that provides support for XML on Lazarus. These units are called "XMLRead", "XMLWrite" and "DOM" and they are part of the Free Component Library (FCL) from the Free Pascal Compiler.