Start of change

Examples of the doc option

  1. In the following example, the first parameter of %XML is the name of a file. Option doc=file must be specified.
       ifsfile = 'myfile.xml';
       opt = 'doc=file';
       XML-INTO myfield %XML(ifsfile : opt);
  2. In the following example, the first parameter of %XML is a character variable containing an XML document. Since the doc option defaults to "string", no options are necessary. However, option doc=string may be specified, as in the second XML-INTO statement below.
       xmldata = '<data><num>3</num></data>';
       XML-INTO data %XML(xmldata);
    
       XML-INTO data %XML(xmldata : 'doc=string');
End of change