Class TTreeDocument
Unit
simplehtmltreeparser
Declaration
type TTreeDocument = class(TTreeNode)
Description
no description available, TTreeNode description follows
This class representates an element of the html file
It is stored in an unusual tree representation: All elements form a linked list and the next element is the first children, or if there is none, the next node on the same level, or if there is none, the closing tag of the current parent. E.g. a xml file like <foo><bar>x</bar></foo> is stored as a quadro-linked list:
/---------------------------------\
| | ----------- | link to parent (for faster access, it would work without it)
\|/ | \|/ | |
' '
<foo> <---> <bar> <---> x <---> </bar> <---> </foo> double linked list of tags (previous link again for faster access, a single linked list would work as well)
. . . .
/|\ /|\ /|\ /|\
| ----------------------- | single linked of corresponding node
---------------------------------------------------
There are functions (getNextSibling, getFirstChild, findNext, ...) to access it like a regular tree, but it is easier and faster to work directly with the list. Some invariants: (SO: set of opening tags in sequence) ∀a \in SO: a < a.reverse ∀a,b \in SO: a < b < a.reverse => a < b.reverse < a.reverse Attributes should be accessed with the getAttribute or getAttributeTry method. Or you can enumerate them all for attrib in attributes , if attributes is not nil. #)
Hierarchy
Overview
Methods
Properties
Description
Methods
 |
function getEncoding: TSystemCodePage; |
Returns the current encoding of the tree. After the parseTree-call it is the detected encoding, but it can be overriden with setEncoding.
|
 |
procedure setEncoding(new: TSystemCodePage; convertFromOldToNew: Boolean; convertEntities: boolean); |
Changes the tree encoding If convertExistingTree is true, the strings of the tree are actually converted, otherwise only the meta encoding information is changed If convertEntities is true, entities like ö are replaced (which is only possible if the encoding is known)
|
 |
destructor destroy; override; |
|
Properties
 |
property baseURI: string read FBaseURI write FBaseURI; |
|
 |
property documentURI: string read FDocumentURI write FDocumentURI; |
|
Generated by PasDoc 0.14.0.
|