[Overview][Types][Classes][Procedures and functions][Index] Reference for unit 'Laz2_XMLRead' (#lazutils)

TDOMParser.ParseWithContext

Parses the XML input source into the specified DOM context Node.

Declaration

Source position: laz2_xmlread.pas line 142

public function TDOMParser.ParseWithContext(

  Src: TXMLInputSource;

  Context: TDOMNode;

  Action: TXMLContextAction

):TDOMNode;

Arguments

Src

  

XML input source for the operation.

Context

  

DOM Node that provides the context for DOM nodes read in the method.

Action

  

Load and Save action requested for the specified context.

Function result

Not used in the current implementation.

Description

ParseWithContext is a TDOMNode function used to read and process XML content in the specified XML input source. ParseWithContext creates DOM nodes needed to represent the XML content.

The newly created DOM nodes are accumulated in a temporary DOM Document Fragment, and its child nodes are ultimately added to the DOM node in Context. The insertion point for the new nodes is determined using the Action argument. When Action contains xaAppendAsChildren or xaReplaceChildren, the nodes are added (or replaced) as child nodes in Context. When Action contains xaInsertBefore, xaInsertAfter, or xaReplace, the nodes are added (or replaced) as child nodes in the parent node for Context.

ParseWithContext creates a TXMLReader that is used to convert and process the XML content in the XML input source. The return value contains the first child node in the DOM Document Fragment created in the method.

Errors

An EDOMNotSupported exception is raised when Action contains xaReplaceChildren and the target node is also a DOM Document node. Replacing the DOM Document is not supported in TDOMParser.

An EDOMHierarchyRequest exception is raised when the target node is not a DOM Element or Document Fragment node.

See also

TXMLInputSource

  

Represents the input source for XML content.

TXMLContextAction

  

Values that control how XML content is stored in a DOM sub-tree.

TDOMNode

  

Implements the DOM Node interface.


Version 4.0 Generated 2025-05-03 Home