TDOMParser.ParseWithContext function
Parses the XML input source into the specified DOM context Node.
Declaration
function ParseWithContext(Src: TXMLInputSource; Context: TDOMNode;
Action: TXMLContextAction): TDOMNodeArguments
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
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
