XML_Parse - Parse XML strings
This function run the XML parser. The XML pointer must be created with XML_ParserCreate.
Note that :
txt = mgetl('SCI/man/eng/expatsci/XML_Parse.xml'); data = struct('store',%f,'tag','PARAM_NAME','str',[]); function [data]=char_handl(data,txt) if data.store then data.str=[data.str; txt] end endfunction function [data]=start_handl(data,el,attr) if el==data.tag then data.store=%t end endfunction function [data]=end_handl(data,el) if el==data.tag then data.store=%f end endfunction %ptr=XML_ParserCreate(); XML_SetUserData(%ptr,'data'); XML_SetElementHandler(%ptr,'start_handl','end_handl'); XML_SetCharDataHandler(%ptr,'char_handl'); XML_Parse(%ptr, txt); //display the value enclosed in xml tag 'PARAM_NAME' data.str
XML_ParserCreate, XML_ParserFree, XML_SetUserData, XML_SetElementHandler, XML_SetCharDataHandler, XML_Conv2Latin, XML_StopParser, XML_ResumeParser,
'The Expat XML Parser', Available: http://expat.sourceforge.net/