Name
CharacterData -- parser has encountered character data
Synopsis
CharacterData(p, s$)
Function
This function is called whenever the parser encounters data that is not part of any XML entity. The data is passed to your callback as a string in the s$ parameter.

Note that the character data for a single XML element might be passed to your callback in several separate chunks so make sure your code doesn't depend on getting all of the character data at once. By default, the XML plugin tries to merge character data into as few chunks of text as possible. You can turn off the merging functionality by passing False in the optional third argument in your call to xml.CreateParser(). Note that even with the merge data option enabled (which is the default) it isn't guaranteed that all data will come in at once so be prepared to handle this correctly.

Parameters
p
parser handle
s$
the character data
Example
Function p_CharacterData(p, s$)
   DebugPrint(s$)
EndFunction

p = xml.CreateParser({CharacterData = p_CharacterData})
p:Parse([[<app>Hollywood</app>]])
p:Free()
The code above will print "Hollywood".

Show TOC