tinymce.dom.Serializer

Namespace tinymce.dom
Class Serializer
This class is used to serialize DOM trees into a string. Consult the TinyMCE Wiki API for more details and examples on how to use this class.

Public Methods

Method Defined By
Serializer(s:Object)
Constucts a new DOM serializer class.
Serializer
addRules(s:String):void
Adds valid elements rules to the serializer this enables you to specify things like what elements should be outputted an...
Serializer
findAttribRule(ru:Object, n:String):Object
Finds an attribute rule object by name.
Serializer
findRule(n:String):Object
Finds a rule object by name.
Serializer
serialize(n:Element, o:Object):String
Serializes the specified node into a HTML string.
Serializer
setEntities(s:String):void
Sets a list of entities to use for the named entity encoded.
Serializer
setRules(s:String):void
Sets the valid elements rules of the serializer this enables you to specify things like what elements should be outputte...
Serializer

Method details

Serializerconstructor

public function Serializer(s:Object)
Constucts a new DOM serializer class.

Parameters

s:Object Optional name/Value collection of settings for the serializer.

addRulesmethod

public function addRules(s:String):void
Adds valid elements rules to the serializer this enables you to specify things like what elements should be outputted and what attributes specific elements might have. Consult the Wiki for more details on this format.

Parameters

s:String Valid elements rules string to add.

findAttribRulemethod

public function findAttribRule(ru:Object, n:String):Object
Finds an attribute rule object by name.

Parameters

ru:Object Rule object to search though.
n:String Name of the rule to retrive.

Returns

Object - Rule object of the specified attribute.

findRulemethod

public function findRule(n:String):Object
Finds a rule object by name.

Parameters

n:String Name to look for in rules collection.

Returns

Object - Rule object found or null if it wasn't found.

serializemethod

public function serialize(n:Element, o:Object):String
Serializes the specified node into a HTML string.

Parameters

n:Element Element/Node to serialize.
o:Object Object to add serialized contents to, this object will also be passed to the event listeners.

Returns

String - Serialized HTML contents.

setEntitiesmethod

public function setEntities(s:String):void
Sets a list of entities to use for the named entity encoded.

Parameters

s:String List of entities in the following format: number,name,....

setRulesmethod

public function setRules(s:String):void
Sets the valid elements rules of the serializer this enables you to specify things like what elements should be outputted and what attributes specific elements might have. Consult the Wiki for more details on this format.

Parameters

s:String Valid elements rules string.