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

<![CDATA[ ]]> XML tag

The <!CDATA[ ]]> tag enables you to include special characters within your XML report definition. The parser ignores any special characters it encounters within the <!CDATA[ ]]> tag. This is particularly useful when including PL/SQL program units or SQL queries that might require special characters.

Syntax

<![CDATA[
  content
]]>

Examples

The following two examples demonstrate the use of the <!CDATA[ ]]> tag to allow characters that would otherwise return parsing errors.

Protecting a PL/SQL function

The following example shows a segment of an XML report definition that uses the <!CDATA[ ]]> tag to protect a PL/SQL function that adds a hyperlink and hyperlink destination to an object in a report.

<programUnits>
<function name="F_ssn1FormatTrigger">
  <![CDATA[
  function F_ssn1FormatTrigger return boolean is
  begin
    SRW.SET_HYPERlink('#EMP_DETAILS_&<' || LTRIM(TO_CHAR(:SSN)) 
      || '>');
    return (TRUE);
  end;
  ]]>
</function>
<function name="F_ssnFormatTrigger">
  <![CDATA[
  function F_ssnFormatTrigger return boolean is
  begin
    SRW.SET_linkTAG('EMP_DETAILS_&<' || LTRIM(TO_CHAR(:SSN)) 
      || '>');
    return (TRUE);
  end;
  ]]>
</function>
</programUnits>

Protecting a greater than sign (<)

The following example shows a segment of an XML report definition that uses the <![CDATA[]]> tag to protect a SQL statement that contains a greater than sign.

<select>
  <![CDATA[
  SELECT ALL VIDEO_CATEGORY_BY_QTR.QUARTER,
  VIDEO_CATEGORY_BY_QTR.TOTAL_PROFIT
  FROM SCOTT.VIDEO_CATEGORY_BY_QTR
  WHERE (VIDEO_CATEGORY_BY_QTR.SALES_REGION='West'
  AND VIDEO_CATEGORY_BY_QTR.TOTAL_PROFIT>2000)
  ]]>
</select>

See also

About XML in reports