ScicosLab Function
Last update : 18/05/2014

XML_SetCharDataHandler - Set function for XML strings handler

Calling Sequence

XML_SetCharDataHandler(%ptr,'char_hdl')

Parameters

Description

This function set the user functions that will be called during the parsing of XML. 'char_hdl' defines the Scilab function name that will be called for the text inside XML tags. The XML pointer must be created with XML_ParserCreate. The input string must be a valid Scilab function name.

Examples

  txt = mgetl('SCI/man/eng/expatsci/XML_Parse.xml');

  //def start_hndl
  function []=start_handl(el,attr)
    printf("Begin of %s \n",el);
  endfunction

  //def end_hndl
  function []=end_handl(el)
    printf("end of %s \n",el);
  endfunction

  //def char_hndl
  function []=char_handl(txt)
    printf("%s \n",txt)
  endfunction

  %ptr=XML_ParserCreate();

  XML_SetElementHandler(%ptr,'start_handl','end_handl');
  XML_SetCharDataHandler(%ptr,'char_handl');

  XML_Parse(%ptr, txt);

  

See Also

XML_ParserCreate,  XML_ParserFree,  XML_SetUserData,  XML_SetElementHandler,  XML_Parse,  XML_Conv2Latin,  XML_StopParser,  XML_ResumeParser,  

Authors

METALAU project-team, INRIA A.Layec

Bibliography

'The Expat XML Parser', Available: http://expat.sourceforge.net/