Difference between revisions of "TDOMDocument"

From Free Pascal wiki
Jump to navigationJump to search
m (Fixed syntax highlighting; deleted category included in page template)
 
Line 1: Line 1:
The TDOMDocument class holds document data according to the [[Document Object Model]] ([[DOM]]).  
+
{{TDOMDocument}}
 +
 
 +
The TDOMDocument class holds document data according to the [[dom|Document Object Model (DOM)]].  
  
 
== Declaration ==
 
== Declaration ==
 +
 
Excerpted from dom.pas
 
Excerpted from dom.pas
<source>
+
 
 +
<syntaxhighlight lang=pascal>
 
TDOMDocument = class(TDOMNode_WithChildren)
 
TDOMDocument = class(TDOMNode_WithChildren)
 
   protected
 
   protected
Line 50: Line 54:
 
     procedure RemoveID(Attr: TDOMAttr);
 
     procedure RemoveID(Attr: TDOMAttr);
 
   end;
 
   end;
</source>
+
</syntaxhighlight>
  
 
Back to [[fcl-xml]] overview.
 
Back to [[fcl-xml]] overview.
  
[[Category:XML]]
+
== See also ==
  
== See also ==
 
 
* [[TXMLDocument]],  
 
* [[TXMLDocument]],  
* [[Document Object Model]] ([https://en.wikipedia.org/wiki/Document_Object_Model Document Object Model at Wikipedia])
+
* [[dom|Document Object Model]]  
 +
 
 +
== External links ==
 +
 
 +
* [https://en.wikipedia.org/wiki/Document_Object_Model Document Object Model at Wikipedia]

Latest revision as of 06:34, 29 February 2020

English (en)

The TDOMDocument class holds document data according to the Document Object Model (DOM).

Declaration

Excerpted from dom.pas

TDOMDocument = class(TDOMNode_WithChildren)
  protected
    FIDList: TList;
    FRevision: Integer;
    FXML11: Boolean;
    FImplementation: TDOMImplementation;
    function GetDocumentElement: TDOMElement;
    function GetDocType: TDOMDocumentType;
    function GetNodeType: Integer; override;
    function GetNodeName: DOMString; override;
    function IndexOfNS(const nsURI: DOMString): Integer;
    function FindID(const aID: DOMString; out Index: LongWord): Boolean;
    procedure ClearIDList;
  public
    property DocType: TDOMDocumentType read GetDocType;
    property Impl: TDOMImplementation read FImplementation;
    property DocumentElement: TDOMElement read GetDocumentElement;

    function CreateElement(const tagName: DOMString): TDOMElement; virtual;
    function CreateElementBuf(Buf: DOMPChar; Length: Integer): TDOMElement;
    function CreateDocumentFragment: TDOMDocumentFragment;
    function CreateTextNode(const data: DOMString): TDOMText;
    function CreateTextNodeBuf(Buf: DOMPChar; Length: Integer): TDOMText;
    function CreateComment(const data: DOMString): TDOMComment;
    function CreateCommentBuf(Buf: DOMPChar; Length: Integer): TDOMComment;
    function CreateCDATASection(const data: DOMString): TDOMCDATASection; virtual;
    function CreateProcessingInstruction(const target, data: DOMString): TDOMProcessingInstruction; virtual;
    function CreateAttribute(const name: DOMString): TDOMAttr;
    function CreateAttributeBuf(Buf: DOMPChar; Length: Integer): TDOMAttr;
    function CreateEntityReference(const name: DOMString): TDOMEntityReference; virtual;
    // Free NodeList with TDOMNodeList.Release!
    function GetElementsByTagName(const tagname: DOMString): TDOMNodeList;

    // DOM level 2 methods
    function ImportNode(ImportedNode: TDOMNode; Deep: Boolean): TDOMNode;
    function CreateElementNS(const NamespaceURI, QualifiedName: DOMString): TDOMElement;
    function CreateAttributeNS(const NamespaceURI, QualifiedName: DOMString): TDOMAttr;
    function GetElementsByTagNameNS(const namespaceURI, localName: DOMString): TDOMNodeList;
    function GetElementById(const ElementID: DOMString): TDOMElement;
    // Extensions to DOM interface:
    // TODO: obsolete now, but must check for usage dependencies
    constructor Create;
    destructor Destroy; override;
    function AddID(Attr: TDOMAttr): Boolean;
    procedure RemoveID(Attr: TDOMAttr);
  end;

Back to fcl-xml overview.

See also

External links