PHP
downloads | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

tidy_error_count> <tidy::__construct
Last updated: Fri, 10 Oct 2008

view this page in

tidy_diagnose

(PHP 5, PECL tidy:0.5.2-1.2)

tidy_diagnoseパース、修正されたマークアップの診断を行う

説明

手続き型:

bool tidy_diagnose ( tidy $object )

オブジェクト指向型:

bool tidy->diagnose ( void )

tidy_diagnose() は、 与えられた Tidy オブジェクト object に対して診断テストを実行し、 エラーバッファにドキュメントについての情報を追加します。

成功した場合に TRUE を、失敗した場合に FALSE を返します。

例1 tidy_diagnose() の例

<?php

$html 
= <<< HTML
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<p>paragraph</p>
HTML;

$tidy tidy_parse_string($html);
$tidy->CleanRepair();

// 2 つの出力の違いに注意
echo tidy_get_error_buffer($tidy) . "\n";

$tidy->diagnose();
echo 
tidy_get_error_buffer($tidy);

?>

上の例の出力は以下となります。

line 5 column 1 - Warning: <p> isn't allowed in <head> elements
line 5 column 1 - Warning: inserting missing 'title' element

line 5 column 1 - Warning: <p> isn't allowed in <head> elements
line 5 column 1 - Warning: inserting missing 'title' element
Info: Doctype given is "-//W3C//DTD XHTML 1.0 Strict//EN"
Info: Document content looks like XHTML 1.0 Strict
2 warnings, 0 errors were found!

tidy_get_error_buffer() も参照ください。



add a note add a note User Contributed Notes
tidy_diagnose
There are no user contributed notes for this page.

tidy_error_count> <tidy::__construct
Last updated: Fri, 10 Oct 2008
 
 
show source | credits | stats | sitemap | contact | advertising | mirror sites