// 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);
// 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 の値として戻されます。
(C) Copyright IBM Corporation 1992, 2006. All Rights Reserved.