0 results found

tinymce.html.SaxParser

Contribute to this page
Namespacetinymce.html
ClassSaxParser
TypeSingleton

Entity encoder class.Version:3.4

Example

Public Methods

MethodDefined By
SaxParser(settings:Object, schema:Schema) : Constructs a new SaxParser instance.SaxParser
encodeAllRaw(text:String):String : [static] Encoded the specified text with both the attributes and text entities.SaxParser
encodeNamed(text:String, attr:Boolean, entities:Object):String : [static] Encodes the specified string using named entities.SaxParser
encodeNumeric(text:String, attr:Boolean):String : [static] Encodes the specified string using numeric entities.SaxParser
encodeRaw(text:String, attr:Boolean):String : [static] Encodes the specified string using raw entities.SaxParser
getEncodeFunc(name:String, entities:String):function : [static] Returns an encode function based on the name(s) and it's optional entities.SaxParser
parse(html:String):void : Parses the specified HTML string and executes the callbacks for each item it finds.SaxParser

Method details

SaxParser

public function SaxParser(settings:Object, schema:Schema)
Constructs a new SaxParser instance.

Parameters

ParamDetail
settings:ObjectName/value collection of settings. comment, cdata, text, start and end are callbacks.
schema:SchemaHTML Schema class to use when parsing.

encodeAllRaw

public static function encodeAllRaw(text:String):String
Encoded the specified text with both the attributes and text entities. This function will produce larger text contents since it doesn't know if the context is within a attribute or text node. This was added for compatibility and is exposed as the DOMUtils.encode function.

Parameters

ParamDetail
text:StringText to encode.

Returns
String - Entity encoded text.

encodeNamed

public static function encodeNamed(text:String, attr:Boolean, entities:Object):String
Encodes the specified string using named entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into named entities.

Parameters

ParamDetail
text:StringText to encode.
attr:BooleanOptional flag to specify if the text is attribute contents.
entities:ObjectOptional parameter with entities to use.

Returns
String - Entity encoded text.

encodeNumeric

public static function encodeNumeric(text:String, attr:Boolean):String
Encodes the specified string using numeric entities. The core entities will be encoded as named ones but all non lower ascii characters will be encoded into numeric entities.

Parameters

ParamDetail
text:StringText to encode.
attr:BooleanOptional flag to specify if the text is attribute contents.

Returns
String - Entity encoded text.

encodeRaw

public static function encodeRaw(text:String, attr:Boolean):String
Encodes the specified string using raw entities. This means only the required XML base entities will be endoded.

Parameters

ParamDetail
text:StringText to encode.
attr:BooleanOptional flag to specify if the text is attribute contents.

Returns
String - Entity encoded text.

getEncodeFunc

public static function getEncodeFunc(name:String, entities:String):function
Returns an encode function based on the name(s) and it's optional entities.

Parameters

ParamDetail
name:StringComma separated list of encoders for example named,numeric.
entities:StringOptional parameter with entities to use instead of the built in set.

Returns
function - Encode function to be used.

parse

public function parse(html:String):void
Parses the specified HTML string and executes the callbacks for each item it finds.

Parameters

ParamDetail
html:StringHtml string to sax parse.

Example

Except as otherwise noted, the content of this page is licensed under the Creative Commons BY-NC-SA 3.0 License, and code samples are licensed under the Apache 2.0 License.