Sign in Join
FPDoc Onlineexperiment

ReadXMLFragment procedure

In unit Laz2_XMLRead

Reads an XML fragment into the specified DOM Node.

Declaration

pascal
procedure ReadXMLFragment(AParentNode: TDOMNode; 
 const AFilename: string; 
 Flags: TXMLReaderFlags=[]); overload

Arguments

AParentNode

DOM Node used as the parent for the XML fragment.

AFilename

File name with the XML content read in the routine.

Flags

Options enabled while reading XML content.

Description

ReadXMLFragment is an overloaded procedure used to read an XML Document Fragment from the specified input source. Overloaded variants are provided that use a file name, a File type, a Text type, or a stream as the input source for the routine. Values read in the method are stored as children in the DOM Node specified in AParentNode.

When using the variant that specifies AFileName, the parameter must represent a valid file name. An exception is raised if AFileName does not exist on the local file system. The value in AFileName is converted to a File URI and used as the BaseURI in the XML Document.

The Flags parameter contains TXMLReaderFlag values enabled in the routine. The default value for the parameter is an empty set ([]), and indicates that no options are enabled by default. Values in the Flags parameter control the behavior enabled when XML content is de-serialized.

ReadXMLFragment creates a TXMLReader instance that is used to read, parse, and store the values from the XML input source using its ProcessFragment method.

See also

An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.