> Expat4D Home > Documentation > Command Reference

xml_Parse ( parserID; textToParse; isFinal) --> errorCode


  • --> parserID : longint
  • --> textToParse : text
  • --> isFinal : longint
  • <-- errorCode : longint

Parses the XML text passed in "textToParse" using the XML parser identified by "parserID". If the text passed is a complete XML document, you can set "isFinal" to 1. If you are parsing a document of greater than 32K you can call this routine repeatedly passing more of the document each time, but passing zero in "isFinal". When you are at the last chunk of the document, pass 1 to "isFinal" to tell the parser that it's now at the end of the document.

If you pass an incomplete XML document and set isFinal to 1, you will generate a parser error.

`Method: parseXML (text)

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

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

C_LONGINT($errorCode)
$errorCode:=xml_Parse($parser;$xmlText;1)
xml_ParserFree($parser)
   


See Also: xml_ParseBLOB

  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