mirror of
https://github.com/sigmasternchen/php-doc-en
synced 2025-03-26 13:58:55 +00:00

fix return/parameter types add some examples rename some files, tidy_node to tidyNode git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@172700 c90b9560-bf6c-de11-be94-00142212c4b1
96 lines
2.5 KiB
XML
96 lines
2.5 KiB
XML
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
<!-- $Revision: 1.7 $ -->
|
|
<refentry id="function.tidy-diagnose">
|
|
<refnamediv>
|
|
<refname>tidy_diagnose</refname>
|
|
<refpurpose>
|
|
Run configured diagnostics on parsed and repaired markup
|
|
</refpurpose>
|
|
</refnamediv>
|
|
<refsect1>
|
|
<title>Description</title>
|
|
<para>Procedural style:</para>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>tidy_diagnose</methodname>
|
|
<methodparam><type>tidy</type><parameter>object</parameter></methodparam>
|
|
</methodsynopsis>
|
|
<para>Object oriented style:</para>
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>tidy->diagnose</methodname>
|
|
<void />
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>tidy_diagnose</function> runs diagnostic tests on the given
|
|
tidy <parameter>object</parameter>, adding some more information about
|
|
the document in the error buffer.
|
|
</para>
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title><function>tidy_diagnose</function> example</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?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();
|
|
|
|
// note the difference between the two outputs
|
|
echo tidy_get_error_buffer($tidy) . "\n";
|
|
|
|
$tidy->diagnose();
|
|
echo tidy_get_error_buffer($tidy);
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
&example.outputs;
|
|
<screen>
|
|
<![CDATA[
|
|
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!
|
|
]]>
|
|
</screen>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
See also <function>tidy_get_error_buffer</function>.
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
Local variables:
|
|
mode: sgml
|
|
sgml-omittag:t
|
|
sgml-shorttag:t
|
|
sgml-minimize-attributes:nil
|
|
sgml-always-quote-attributes:t
|
|
sgml-indent-step:1
|
|
sgml-indent-data:t
|
|
indent-tabs-mode:nil
|
|
sgml-parent-document:nil
|
|
sgml-default-dtd-file:"../../../../manual.ced"
|
|
sgml-exposed-tags:nil
|
|
sgml-local-catalogs:nil
|
|
sgml-local-ecat-files:nil
|
|
End:
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
vim: et tw=78 syn=sgml
|
|
vi: ts=1 sw=1
|
|
-->
|