A script-enabled browser is required for this page to function properly.

SRW.SET_XML_PROLOG built-in function

This 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.

Syntax

SRW.SET_XML_PROLOG(type, 'string');

Parameter

Description

type

Is SRW.FILE_ESCAPE or SRW.TEXT_ESCAPE. It indicates whether the string parameter is a filename or the text to be inserted.

string

Is a filename or the text to be inserted, depending on what you specified for the type parameter.

Restrictions

Example

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;

See also

XML Prolog Type property

XML Prolog Value property