Class tNodeInfo

DescriptionHierarchyFieldsMethodsProperties

Unit

Declaration

type tNodeInfo = class(TObject)

Description

Dynamic structure used to pass information to a ForEachNode callback.

The tNodeInfo class is used to pass information about a TidyNode from the ForEachNode() procedure to its tNodeCallback procedure.

This object is created, initialized, and destroyed automatically by the ForEachNode() procedure.

You should never need to create an instance of this object directly.

Hierarchy

Overview

Methods

Public constructor Create(aDoc:pTidyDoc);
Public destructor Destroy; override;

Properties

Public property Proceed: boolean (read/write);
Public property Doc: pTidyDoc (read-only);
Public property Node: pTidyNode (read-only);
Public property Next: pTidyNode (read-only);
Public property Prev: pTidyNode (read-only);
Public property Child: pTidyNode (read-only);
Public property Parent: pTidyNode (read-only);
Public property Attr: pTidyAttr (read-only);
Public property Kind: TidyNodeType (read-only);
Public property Tag: TidyTagId (read-only);
Public property Row: uint (read-only);
Public property Col: uint (read-only);
Public property Name: pChar (read-only);
Public property Text: pChar (read-only);
Public property Content: pChar (read-only);
Public property StartTag: pChar (read-only);
Public property EndTag: pChar (read-only);
Public property Level: LongInt (read-only);
Public property EndTagRule: tEndTagRule (read-only);
Public property DetectedXml: boolean (read-only);

Description

Methods

Public constructor Create(aDoc:pTidyDoc);

Used internally by ForEachNode() to create a new tNodeInfo instance, which will then be passed to the callback.

Public destructor Destroy; override;

Used internally by ForEachNode() to destroy the tNodeInfo instance, after all callbacks have returned.

Properties

Public property Proceed: boolean (read/write);

Setting this property to False will trigger a "BREAK" statement in the calling ForEachNode procedure. The default is True, which means that ForEachNode will continue passing nodes to the callback. But if you set it to False from within your callback, it will cause ForEachNode to cancel iteration.

Public property Doc: pTidyDoc (read-only);

The TidyDoc instance that was passed to the ForEachNode procedure

Public property Node: pTidyNode (read-only);

The currently indexed node in the ForEachNode procedure's loop.

Public property Next: pTidyNode (read-only);

The next sibling node relative to the current node.

Public property Prev: pTidyNode (read-only);

The previous sibling node relative to the current node.

Public property Child: pTidyNode (read-only);

The first child node of the current node.

Public property Parent: pTidyNode (read-only);

The parent node of the current node.

Public property Attr: pTidyAttr (read-only);

Opaque list of name=value pairs of the current element attributes, or Nil if the node has no attributes.

You can access the individual attributes in the list by calling the TidyLib attribute functions directly, or by using the ForEachAttr() procedure.

Public property Kind: TidyNodeType (read-only);

The TidyNodeType of the current node.

Public property Tag: TidyTagId (read-only);

The TidyTagId of the current node.

Public property Row: uint (read-only);

The one-based line number of the start of the current node in the document's text.

Note that is only valid on a "clean" document, that is, a document that TidyLib did not need to modify.

Usually, the only way to insure that this position is valid is to feed TidyLib's output text back into its input, and compare that the text of the input and output are identical. This can be done automatically from a TTidy object, by setting the Congruent property to True.

Public property Col: uint (read-only);

The one-based character offset (column) into the line where the current node starts.

( See also, the note about character positions in the tNodeInfo.Row property. )

Public property Name: pChar (read-only);

The name of the current node. Usually, this is the name of the element ( such as "head" or "table" ) but for doctype nodes, it is the name of the document type, e.g. "html" or "xhtml".

It is Nil for text nodes.

Public property Text: pChar (read-only);

The text of the current node for nodes such as text, scripts or cdata.

It is Nil for HTML elements, doctypes, xml declarations, etc.

Public property Content: pChar (read-only);

The concatenated text and tags of all child nodes of the current node, a la "innerHtml"

Public property StartTag: pChar (read-only);

The text of the current opening tag, e.g. <span class="foo"> .

( NIL for text nodes )

Public property EndTag: pChar (read-only);

The text of the closing tag of the current node, e.g. </span> .

It is Nil for text nodes, or empty nodes such as <br> that don't have a closing tag.

Note that the EndTag value is always present for elements with optional end tags, regardless of their presence on the original document.

Public property Level: LongInt (read-only);

The level of nesting of the current node.

For instance, the root node is level #0, the <!DOCTYPE> and <html> nodes are at level #1, the <head> and <body> nodes are at level #2, etc...

Public property EndTagRule: tEndTagRule (read-only);

The HTML rule regarding the presence of an end tag for this element.

Can be one of etRequired, etOptional, or etForbidden.

Note that in XHTML, there is no such thing as an "optional" end tag, consider etOptional the same as etRequired for XHTML.

Public property DetectedXml: boolean (read-only);

True if the parser found an XML declaration in the document, or if other semantics indicate the document is XML or XHTML.


Generated by PasDoc 0.10.0 on 2005-12-23 21:07:56

Support This Project  
Get CurlPas and TidyPas at SourceForge.net. Fast, secure and Free Open Source software downloads