> Expat4D Home > Documentation > Command Reference

xml_SetCommentHandler ( parserID; handler )


  • --> parserID : longint
  • --> handler : string[31]

Set the handler method for XML comments. When comments are found in the XML being parsed, they are passed to the 4D method set using this method as text without their enclosing comment tags.

The handler method is supplied the parserID and the comment text and should be set up something like the following example.

`Method: handler_Comment (parser; comment)

C_LONGINT($1;$parser)
C_TEXT($2;$comment)

$parser:=$1
$comment:=$2

`do something with comment if necessary
`...
   
`Method: parseXML (text)

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

C_LONGINT($parser)
$parser:=xml_ParserCreate("")
xml_SetCommentHandler($parser;"handler_Comment")

C_LONGINT($errorCode)
$errorCode:=xml_Parse($parser;$xmlText;1)
xml_ParserFree($parser)
   
  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