XML-SAX 命令コードの %XML オプション

doc (デフォルト string)
doc オプションは、%XML のソース・オペランドに含まれるものを示しています。
図 385. doc オプションの例
   // 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 (デフォルト job)
ccsid オプションは、XML データが戻される CCSID を指定します。
図 386. ccsid オプションの例
   // 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');

注: *XML_UCS2_REF および *XML_ATTR_UCS2_REF イベントの場合、ccsid オプションとは無関係に、データは常に UCS-2 の値として戻されます。