%XML options for the XML-SAX operation code

doc (default string)
The doc option indicates what the source operand of %XML contains.
Figure 418. Example of the doc option:
   // 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-SAX %handler(hdlr:comm) %XML(ifsfile : opt);

   // In the following example, the first parameter
   // of %XML is an XML document.  Since the "doc"
   // option defaults to "string", no options are
   // necessary.

   xmldata = '<data><num>3</num></data>';
   XML-SAX %handler(hdlr:comm) %XML(xmldata);
ccsid (default job)
The ccsid option specifies the CCSID that the XML data should be returned in.
Figure 419. Example of the ccsid option:
   // In the following example, the data is to be
   // returned in the job ccsid.  Even though the
   // default for the "ccsid" option is "job", it
   // is valid to specify it explicitly.

   XML-SAX %handler(hdlr:comm) %XML(xmlString : 'ccsid=job');

   // In the following example, the data is to be
   // returned in UCS-2.

   opt = 'ccsid=ucs2';
   XML-SAX %handler(hdlr:comm) %XML(xmldata : opt);

   // In the following example, the data is to be
   // returned in UTF-8.  The handling procedure must
   // exercise caution to convert the data to some CCSID
   // that the program can handle, if the data is to be
   // used within the handling procedure.

   XML-SAX %handler(hdlr:comm) %XML(xmldata : 'ccsid=1208');

Note: For *XML_UCS2_REF and *XML_ATTR_UCS2_REF events, the data is always returned as a UCS-2 value independent of the ccsid option.



[ Top of Page | Previous Page | Next Page | Contents | Index ]