xmlread
English · Español
Provides an XML reader, which can read XML data from a file or stream. The data is stored in a TXMLDocument.
Declarations
Declarations excerpted from xmlread.pas.
procedure ReadXMLFile(out ADoc: TXMLDocument; const AFilename: WideString); overload;
procedure ReadXMLFile(out ADoc: TXMLDocument; var f: Text); overload;
procedure ReadXMLFile(out ADoc: TXMLDocument; var f: TStream); overload;
procedure ReadXMLFile(out ADoc: TXMLDocument; var f: TStream; const ABaseURI: WideString); overload;
procedure ReadXMLFragment(AParentNode: TDOMNode; const AFilename: WideString); overload;
procedure ReadXMLFragment(AParentNode: TDOMNode; var f: Text); overload;
procedure ReadXMLFragment(AParentNode: TDOMNode; var f: TStream); overload;
procedure ReadXMLFragment(AParentNode: TDOMNode; var f: TStream; const ABaseURI: WideString); overload;
procedure ReadDTDFile(out ADoc: TXMLDocument; const AFilename: WideString); overload;
procedure ReadDTDFile(out ADoc: TXMLDocument; var f: Text); overload;
procedure ReadDTDFile(out ADoc: TXMLDocument; var f: TStream); overload;
procedure ReadDTDFile(out ADoc: TXMLDocument; var f: TStream; const ABaseURI: WideString); overload;Encodings
The parser can read files encoded in UTF-8, UTF-16 (both endianness), and ISO-8859-1.
White space handling
Regarding whitespace handling: By default, whitespace directly after the beginning of a tag is discarded, and sections of the XML file which contain only whitespace and no other text content are discarded as well. However, whitespace-preserving mode can be enabled by setting TDOMParser.Options.PreserveWhitespace property to True.
DTD support
It supports DTD validation. Regarding entity references: The pre-defined entities "lt", "gt", "amp", "apos" and "quot", and internal entities declared in DTD, are replaced by their defined values during reading. Ability to resolve external entities is currently limited to the file system.
Back to fcl-xml overview.
See also
From the Free Pascal wiki, page "xmlread", as it stood on 2020-03-03 after a change by Trev, out of the wiki's dump of 2024-05-26. Copyright stays with the author who wrote it, according to the old wiki's Licensing page. If you have concerns about this material, message the admin.
Talk about this page
Nobody has opened a bench for this page yet. Sign in to open one.
