|
Moodle
2.2.1
http://www.collinsharper.com
|
Public Member Functions | |
| SimpleHtmlSaxParser (&$listener) | |
| parse ($raw) | |
| acceptStartToken ($token, $event) | |
| acceptEndToken ($token, $event) | |
| acceptAttributeToken ($token, $event) | |
| acceptEntityToken ($token, $event) | |
| acceptTextToken ($token, $event) | |
| ignore ($token, $event) | |
Static Public Member Functions | |
| & | createLexer (&$parser) |
| decodeHtml ($html) | |
| normalise ($html) | |
Data Fields | |
| $_lexer | |
| $_listener | |
| $_tag | |
| $_attributes | |
| $_current_attribute | |
Definition at line 543 of file parser.php.
| acceptAttributeToken | ( | $ | token, |
| $ | event | ||
| ) |
Part of the tag data.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 639 of file parser.php.

| acceptEndToken | ( | $ | token, |
| $ | event | ||
| ) |
Accepts a token from the end tag mode. The element name is converted to lower case.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 625 of file parser.php.
| acceptEntityToken | ( | $ | token, |
| $ | event | ||
| ) |
A character entity.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 660 of file parser.php.
| acceptStartToken | ( | $ | token, |
| $ | event | ||
| ) |
Accepts a token from the tag mode. If the starting element completes then the element is dispatched and the current attributes set back to empty. The element or attribute name is converted to lower case.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 597 of file parser.php.

| acceptTextToken | ( | $ | token, |
| $ | event | ||
| ) |
Character data between tags regarded as important.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 671 of file parser.php.
| & createLexer | ( | &$ | parser | ) | [static] |
Sets up the matching lexer. Starts in 'text' mode.
| SimpleSaxParser | $parser | Event generator, usually $self. |
Definition at line 581 of file parser.php.

| decodeHtml | ( | $ | html | ) | [static] |
Decodes any HTML entities.
| string | $html | Incoming HTML. |
Definition at line 693 of file parser.php.

| ignore | ( | $ | token, |
| $ | event | ||
| ) |
Incoming data to be ignored.
| string | $token | Incoming characters. |
| integer | $event | Lexer event type. |
Definition at line 682 of file parser.php.
| normalise | ( | $ | html | ) | [static] |
Turns HTML into text browser visible text. Images are converted to their alt text and tags are supressed. Entities are converted to their visible representation.
| string | $html | HTML to convert. |
Definition at line 706 of file parser.php.


| parse | ( | $ | raw | ) |
Runs the content through the lexer which should call back to the acceptors.
| string | $raw | Page text to parse. |
Definition at line 570 of file parser.php.
| SimpleHtmlSaxParser | ( | &$ | listener | ) |
Sets the listener.
| SimpleSaxListener | $listener | SAX event handler. public |
Definition at line 555 of file parser.php.

| $_attributes |
Definition at line 547 of file parser.php.
| $_current_attribute |
Definition at line 548 of file parser.php.
| $_lexer |
Definition at line 544 of file parser.php.
| $_listener |
Definition at line 545 of file parser.php.
| $_tag |
Definition at line 546 of file parser.php.