26.27 STRIPHTMLファンクションのシグネチャ2
このファンクションは、HTMLタグを削除しプレーン・テキストを残してp_string
(CLOB)を返します。
このファンクションは、HTMLコンテンツのタイプを問わず、すべてのHTML属性を削除します。たとえば、JavaScriptやCSSなどのコンテンツは保持しますが、スクリプトおよびCSS HTMLタグは削除します。
構文
APEX_ESCAPE.STRIPHTML (
p_string IN CLOB )
RETURN CLOB deterministic;
パラメータ
パラメータ | 説明 |
---|---|
p_string |
入力テキスト文字列。 |
例
BEGIN
sys.htp.p(apex_escape.striphtml(
q'[<p id="greeting">Hello <b>Joe</b></p>]'
));
END;
Result:
---------------------------------------------------------------------------
Hello Joe
---------------------------------------------------------------------------
BEGIN
sys.htp.p(apex_escape.striphtml(q'[
<html>
<head>
<title>Web Page</title>
</head>
<body>
<h1>Page Title</h1>
<p>
This is some text.
</p>
</body>
</html>
]'));
END;
Result:
---------------------------------------------------------------------------
Web Page
Page Title
This is some text.
親トピック: APEX_ESCAPE