SRW.SET_XML_PROLOG
built-in functionThis function replaces the current report's XML prolog. You need to specify
the required XML prolog (<?xml version="1.0"?>
),
but you can also specify the encoding and other comments.
SRW.SET_XML_PROLOG(type, 'string');
Parameter |
Description |
type |
Is |
string |
Is a filename or the text to be inserted, depending on what you specified for the type parameter. |
SRW.SET_XML_PROLOG
should be set in a trigger that fires before
the report starts formatting, such as the Before Report trigger.
FUNCTION AfterPForm return boolean is
reports_nls_lang varchar2(255);
encoding varchar2(30);
meta_tag varchar2(255);
xml_tag varchar2(255);
begin
/* This example gets the NLS_LANG setting from the environment
** and maps it to appropriate IANA character set (encoding).
** This is later used to set the XML encoding attribute and
** HTML charset attribute in the output.
*/
-- read the NLS_LANG env. variable tool_env.getvar('NLS_LANG',reports_nls_lang);
-- Obtain equivalent IANA character set encoding:=web_nls.encoding(reports_nls_lang);
if encoding != '0' then
meta_tag:='<META HTTP-EQUIV="Content-Type" CONTENT="text/html;
charset='||encoding||'">'||chr(10);
xml_tag:='<?xml version="1.0" encoding="'||encoding||'"?>';
else
meta_tag:='<!-- No equivalent IANA characterset for Oracle
charset: '||substr(reports_nls_lang,instr(reports_nls_lang,'.')+1,30)||' -->';
xml_tag:='<?xml version="1.0"?>';
end if;
srw.set_xml_prolog(srw.text_escape, xml_tag);
SRW.SET_BEFORE_REPORT_HTML(SRW.TEXT_ESCAPE,'<HTML>'||chr(10)||
meta_tag||'<body dir=&Direction bgcolor="#ffffff">');
return (TRUE);
end;
Copyright © 1984, 2005, Oracle. All rights reserved.