> Expat4D Home > Documentation > Command Reference

xml_ParserFree ( parserID )


  • <-> parserID : longint

Frees the memory used by the parser identified by parserID. Once you have finished using a parser, you should call this routine to prevent memory leaks. ParserIDs are similar to hierarchical list references in that once you lose it, you have a memory leak on your hands.

Expat4D has a fairly low memory requirement because of the way in which it works. You can parse as little or as much of a document at any one time as you want, so if you want to parse it in 8k chunks, that is fine with this plug-in. But it is still important that you free the parser memory as soon as you're finished with it and even more important that you don't lose the parserID which is your only connection to the parser.

`Method: parseXML (text)

C_TEXT($1;$xmlText)
$xmlText:=$1

C_LONGINT($parser)
$parser:=xml_ParserCreate("")
xml_SetElementHandler($parser;"handler_startElement";"handler_endElement")

C_LONGINT($errorCode)
$errorCode:=xml_Parse($parser;$xmlText;1)
xml_ParserFree($parser) `IMPORTANT! - free the parser RAM
   

See Also: xml_ParserCreate, xml_ParserCreateNS

  Expat4D Logo

Developer Documentation

Creating Parsers, Destroying Parsers, Parsing Text

Configuring Handler Methods

Position and Error Reporting Functions

Miscellaneous Functions

Output Buffer Functions

Error Codes


> Expat4D Home > Documentation > Command Reference

Last Modified: 27th April 2001 at 9:00 PM