TXMLDocument xml declaration (Delphi)
Description
This example uses the following properties: Version, Encoding, and StandAlone.
Code
procedure Test_Declaration;
var
LDocument: IXMLDocument;
begin
LDocument := TXMLDocument.Create(nil);
LDocument.LoadFromXML
('<?xml version="1.0" encoding="UTF-16" standalone="yes"?>' +
'<TestElement>Inner text</TestElement>');
{ Display document version, encoding and stand-alone properties. }
Writeln('Version: ' + LDocument.Version);
Writeln('Encoding: ' + LDocument.Encoding);
Writeln('StandAlone: ' + LDocument.StandAlone);
end;
Uses
- Xml.XMLDoc.TXMLDocument.LoadFromXML ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.Version ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.Encoding ( fr | de | ja )
- Xml.XMLDoc.TXMLDocument.StandAlone ( fr | de | ja )