> Expat4D Home > Documentation > Command Reference

xml_ParseBLOB ( parserID; BLOBtoParse) --> errorCode


  • --> parserID : longint
  • --> BLOBtoParse : blob
  • <-- errorCode : longint

Parses the XML BLOB passed in "BLOBtoParse" using the XML parser identified by "parserID". The BLOB should contain a complete XML document allowing you to easily convert documents stored in files by using 4D's DOCUMENT TO BLOB command then xml_ParseBLOB. The BLOB is not duplicated in RAM so this method is in some ways more efficient that xml_Parse, even on small documents.

`Method: parseXMLdocument (filePath)

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

C_BLOB($xmlBLOB)
DOCUMENT TO BLOB($filePath;$xmlBLOB)
$xmlText:=$1

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

C_LONGINT($errorCode)
$errorCode:=xml_ParseBLOB($parser;$xmlBLOB)
xml_ParserFree($parser) `IMPORTANT! - free the parser RAM
   

See Also: xml_Parse

  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