ScicosLab Function
Last update : 18/05/2014

XML_SetElementHandler - Set functions for elements handler

Calling Sequence

XML_SetElementHandler(%ptr,'start_hdl','end_hdl')

Parameters

Description

This function set the user functions that will be called during the parsing of XML. 'start_hdl' defines the Scilab function name that will be called when encountering an input XML tag. 'end_hdl' defines the Scilab function name that will be called when encountering an ending XML tag. The XML pointer must be created with XML_ParserCreate. The input strings must be a valid Scilab functions 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
  
  %ptr=XML_ParserCreate();
  
  XML_SetElementHandler(%ptr,'start_handl','end_handl');
  
  XML_Parse(%ptr, txt);
  

See Also

XML_ParserCreate,  XML_ParserFree,  XML_SetUserData,  XML_SetCharDataHandler,  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/