21.25 SET_HTML_ESCAPING_MODE Procedure

The SET_HTML_ESCAPING_MODE procedure configures HTML escaping mode for apex_escape.html.

Syntax

APEX_ESCAPE.SET_HTML_ESCAPING_MODE (
    p_mode IN VARCHAR2);

Parameters

Table 21-27 APEX_ESCAPE.SET_HTML_ESCAPING_MODE Procedure Parameters

Parameter Description

p_mode

If equal to B, then do basic escaping, like sys.htf.escape_sc. If equal to E, then do extended escaping.

Example

This example tests escaping in basic (B) and extended (E) mode.

DECLARE 
procedure eq(p_str1 in varchar2,p_str2 in varchar2) 
    is 
    BEGIN 
        IF p_str1||'.' <> p_str2||'.' THEN 
            raise_application_error(-20001,p_str1||' <> '||p_str2); 
    END IF; 
END eq; 
BEGIN 
    apex_escape.set_html_escaping_mode('B'); 
    eq(apex_escape.html('hello &"<>''/'), 'hello &amp;&quot;&lt;&gt;''/'); 
    apex_escape.set_html_escaping_mode('E'); 
    eq(apex_escape.html('hello &"<>''/'), 'hello
    &amp;&quot;&lt;&gt;&#x27;&#x2F;'); 
END;