TDOMDocument: what changed
Revision 0 to 1. Removed lines have a minus sign; added lines have a plus sign.
Title: TDOMDocument
| Old | New | Line | |
|---|---|---|---|
| 1 | + | The TDOMDocument class holds document data according to the [[dom|Document Object Model (DOM)]]. | |
| 2 | + | ||
| 3 | + | ## Declaration | |
| 4 | + | ||
| 5 | + | Excerpted from dom.pas | |
| 6 | + | ||
| 7 | + | ``` pascal | |
| 8 | + | TDOMDocument = class(TDOMNode_WithChildren) | |
| 9 | + | protected | |
| 10 | + | FIDList: TList; | |
| 11 | + | FRevision: Integer; | |
| 12 | + | FXML11: Boolean; | |
| 13 | + | FImplementation: TDOMImplementation; | |
| 14 | + | function GetDocumentElement: TDOMElement; | |
| 15 | + | function GetDocType: TDOMDocumentType; | |
| 16 | + | function GetNodeType: Integer; override; | |
| 17 | + | function GetNodeName: DOMString; override; | |
| 18 | + | function IndexOfNS(const nsURI: DOMString): Integer; | |
| 19 | + | function FindID(const aID: DOMString; out Index: LongWord): Boolean; | |
| 20 | + | procedure ClearIDList; | |
| 21 | + | public | |
| 22 | + | property DocType: TDOMDocumentType read GetDocType; | |
| 23 | + | property Impl: TDOMImplementation read FImplementation; | |
| 24 | + | property DocumentElement: TDOMElement read GetDocumentElement; | |
| 25 | + | ||
| 26 | + | function CreateElement(const tagName: DOMString): TDOMElement; virtual; | |
| 27 | + | function CreateElementBuf(Buf: DOMPChar; Length: Integer): TDOMElement; | |
| 28 | + | function CreateDocumentFragment: TDOMDocumentFragment; | |
| 29 | + | function CreateTextNode(const data: DOMString): TDOMText; | |
| 30 | + | function CreateTextNodeBuf(Buf: DOMPChar; Length: Integer): TDOMText; | |
| 31 | + | function CreateComment(const data: DOMString): TDOMComment; | |
| 32 | + | function CreateCommentBuf(Buf: DOMPChar; Length: Integer): TDOMComment; | |
| 33 | + | function CreateCDATASection(const data: DOMString): TDOMCDATASection; virtual; | |
| 34 | + | function CreateProcessingInstruction(const target, data: DOMString): TDOMProcessingInstruction; virtual; | |
| 35 | + | function CreateAttribute(const name: DOMString): TDOMAttr; | |
| 36 | + | function CreateAttributeBuf(Buf: DOMPChar; Length: Integer): TDOMAttr; | |
| 37 | + | function CreateEntityReference(const name: DOMString): TDOMEntityReference; virtual; | |
| 38 | + | // Free NodeList with TDOMNodeList.Release! | |
| 39 | + | function GetElementsByTagName(const tagname: DOMString): TDOMNodeList; | |
| 40 | + | ||
| 41 | + | // DOM level 2 methods | |
| 42 | + | function ImportNode(ImportedNode: TDOMNode; Deep: Boolean): TDOMNode; | |
| 43 | + | function CreateElementNS(const NamespaceURI, QualifiedName: DOMString): TDOMElement; | |
| 44 | + | function CreateAttributeNS(const NamespaceURI, QualifiedName: DOMString): TDOMAttr; | |
| 45 | + | function GetElementsByTagNameNS(const namespaceURI, localName: DOMString): TDOMNodeList; | |
| 46 | + | function GetElementById(const ElementID: DOMString): TDOMElement; | |
| 47 | + | // Extensions to DOM interface: | |
| 48 | + | // TODO: obsolete now, but must check for usage dependencies | |
| 49 | + | constructor Create; | |
| 50 | + | destructor Destroy; override; | |
| 51 | + | function AddID(Attr: TDOMAttr): Boolean; | |
| 52 | + | procedure RemoveID(Attr: TDOMAttr); | |
| 53 | + | end; | |
| 54 | + | ``` | |
| 55 | + | ||
| 56 | + | Back to [[fcl-xml]] overview. | |
| 57 | + | ||
| 58 | + | ## See also | |
| 59 | + | ||
| 60 | + | - [[TXMLDocument]], | |
| 61 | + | - [[dom|Document Object Model]] | |
| 62 | + | ||
| 63 | + | ## External links | |
| 64 | + | ||
| 65 | + | - [Document Object Model at Wikipedia](https://en.wikipedia.org/wiki/Document_Object_Model) | |
| 66 | + | ||
| 67 | + | --- | |
| 68 | + | *From the Free Pascal wiki, page "TDOMDocument", as it stood on 2020-02-29 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](/wiki-contact).* |
