cvs: phpdoc /en/reference/tidy book.xml tidy.xml /en/reference/tidy/tidy body.xml cleanrepair.xml construct.xml diagnose.xml getconfig.xml
gethtmlver.xml getopt.xml getoptdoc.xml getrelease.xml getstatus.xml head.xml html.xml isxhtml.xml isxml.xml parsefile.xml parsestring.xml
repairfile.xml repairstring.xml root.xml
| From: | Damien Seguy | Date: | Sat, 25 Apr 2009 18:37:21 +0000 |
| Subject: | cvs: phpdoc /en/reference/tidy book.xml tidy.xml /en/reference/tidy/tidy body.xml cleanrepair.xml construct.xml diagnose.xml getconfig.xml gethtmlver.xml getopt.xml getoptdoc.xml getrelease.xml getstatus.xml head.xml html.xml isxhtml.xml isxml.xml parsefile.xml parsestring.xml repairfile.xml repairstring.xml root.xml |
||
| Groups: | php.doc.cvs | ||
| Request: | Send a blank email to doc-cvs+get-3873@lists.php.net to get a copy of this message | ||
dams Sat Apr 25 18:37:21 2009 UTC
Added files:
/phpdoc/en/reference/tidy tidy.xml
/phpdoc/en/reference/tidy/tidy body.xml cleanrepair.xml
construct.xml diagnose.xml
getconfig.xml gethtmlver.xml
getopt.xml getoptdoc.xml
getrelease.xml getstatus.xml
head.xml html.xml isxhtml.xml
isxml.xml parsefile.xml
parsestring.xml repairfile.xml
repairstring.xml root.xml
Modified files:
/phpdoc/en/reference/tidy book.xml
Log:
migration to oop doc
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/book.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/tidy/book.xml diff -u phpdoc/en/reference/tidy/book.xml:1.3 phpdoc/en/reference/tidy/book.xml:1.4 --- phpdoc/en/reference/tidy/book.xml:1.3 Fri Apr 24 13:20:06 2009 +++ phpdoc/en/reference/tidy/book.xml Sat Apr 25 18:37:20 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <book xml:id="book.tidy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Tidy</title> @@ -18,6 +18,7 @@ &reference.tidy.setup; &reference.tidy.constants; &reference.tidy.examples; + &reference.tidy.tidy; &reference.tidy.tidynode; &reference.tidy.reference; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy.xml +++ phpdoc/en/reference/tidy/tidy.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.tidy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The <classname>Tidy</classname> class</title> <titleabbrev>Tidy</titleabbrev> <partintro> <!-- {{{ tidy intro --> <section xml:id="tidy.intro"> &reftitle.intro; <para> An HTML node in an HTML file, as detected by tidy. </para> </section> <!-- }}} --> <section xml:id="tidy.synopsis"> &reftitle.classsynopsis; <!-- {{{ Synopsis --> <classsynopsis> <ooclass><classname>Tidy</classname></ooclass> <!-- {{{ Class synopsis --> <classsynopsisinfo> <ooclass> <classname>Tidy</classname> </ooclass> </classsynopsisinfo> <!-- }}} --> <classsynopsisinfo role="comment">Properties</classsynopsisinfo> <classsynopsisinfo role="comment">Methods</classsynopsisinfo> <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.tidy')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> </classsynopsis> <!-- }}} --> </section> <!-- {{{ Tidy properties --> <section xml:id="tidy.props"> &reftitle.properties; <variablelist> <varlistentry xml:id="tidy.props.body"> <term><varname>errorBuffer</varname></term> <listitem> <para> The last warnings and errors from TidyLib </para> </listitem> </varlistentry> </variablelist> <!-- <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.1.0</entry> <entry><varname>line</varname>, <varname>column</varname> and <varname>proprietary</varname> were added</entry> </row> </tbody> </tgroup> </informaltable> </para> --> </section> <!-- }}} --> </partintro> &reference.tidy.entities.tidy; </phpdoc:classref> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/body.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/body.xml +++ phpdoc/en/reference/tidy/tidy/body.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.body" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::body</refname> <refname>tidy_get_body</refname> <refpurpose>Returns a tidyNode Object starting from the <body> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_body</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::body</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <body> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the detected HTML version. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return <literal>0</literal>. </para> </warning> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getBody</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $body = $tidy->Body(); echo $body->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <body> <p>paragraph</p> </body> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::head</function></member> <member><function>tidy::html</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/cleanrepair.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/cleanrepair.xml +++ phpdoc/en/reference/tidy/tidy/cleanrepair.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.cleanrepair" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::CleanRepair</refname> <refname>tidy_clean_repair</refname> <refpurpose>Execute configured cleanup and repair operations on parsed markup</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_clean_repair</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::cleanRepair</methodname> <void /> </methodsynopsis> <para> This function cleans and repairs the given tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::cleanrepair</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>test</I>'; $tidy = tidy_parse_string($html); $tidy->CleanRepair(); echo $tidy; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title></title> </head> <body> <p>test</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::repairFile</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/construct.xml +++ phpdoc/en/reference/tidy/tidy/construct.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::__construct</refname> <refpurpose>Constructs a new <classname>tidy</classname> object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>tidy</type><methodname>tidy::__construct</methodname> <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> </methodsynopsis> <para> Constructs a new <classname>tidy</classname> object. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> If the <parameter>filename</parameter> parameter is given, this function will also read that file and initialize the object with the file, acting like <function>tidy_parse_file</function>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal>, and <literal>shiftjis</literal>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the new <classname>tidy</classname> instance. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::__construct</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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head><title>title</title></head> <body> <p>paragraph <bt /> text</p> </body></html> HTML; $tidy = new tidy(); $tidy->ParseString($html); $tidy->CleanRepair(); if ($tidy->errorBuffer) { echo "The following errors were detected:\n"; echo $tidy->errorBuffer; } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ The following errors were detected: line 8 column 14 - Error: <bt> is not recognized! line 8 column 14 - Warning: discarding unexpected <bt> ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/diagnose.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/diagnose.xml +++ phpdoc/en/reference/tidy/tidy/diagnose.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidy-diagnose" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::diagnose</refname> <refname>tidy_diagnose</refname> <refpurpose>Run configured diagnostics on parsed and repaired markup</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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> Runs diagnostic tests on the given tidy <parameter>object</parameter>, adding some more information about the document in the error buffer. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <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->errorBuffer . "\n"; $tidy->diagnose(); echo $tidy->errorBuffer; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ line 4 column 1 - Warning: <p> isn't allowed in <head> elements line 4 column 1 - Warning: inserting missing 'title' element line 4 column 1 - Warning: <p> isn't allowed in <head> elements line 4 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> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::errorBuffer</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getconfig.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getconfig.xml +++ phpdoc/en/reference/tidy/tidy/getconfig.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getconfig" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::getConfig</refname> <refname>tidy_get_config</refname> <refpurpose>Get current Tidy configuration</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>array</type><methodname>tidy_get_config</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>array</type><methodname>tidy::getConfig</methodname> <void /> </methodsynopsis> <para> Gets the list of the configuration options in use by the given tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of configuration options. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getConfig</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>test</p>'; $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($html, $config); print_r($tidy->getConfig()); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Array ( [indent-spaces] => 2 [wrap] => 200 [tab-size] => 8 [char-encoding] => 1 [input-encoding] => 3 [output-encoding] => 1 [newline] => 1 [doctype-mode] => 1 [doctype] => [repeated-attributes] => 1 [alt-text] => [slide-style] => [error-file] => [output-file] => [write-back] => [markup] => 1 [show-warnings] => 1 [quiet] => [indent] => 1 [hide-endtags] => [input-xml] => [output-xml] => 1 [output-xhtml] => 1 [output-html] => [add-xml-decl] => [uppercase-tags] => [uppercase-attributes] => [bare] => [clean] => [logical-emphasis] => [drop-proprietary-attributes] => [drop-font-tags] => [drop-empty-paras] => 1 [fix-bad-comments] => 1 [break-before-br] => [split] => [numeric-entities] => [quote-marks] => [quote-nbsp] => 1 [quote-ampersand] => 1 [wrap-attributes] => [wrap-script-literals] => [wrap-sections] => 1 [wrap-asp] => 1 [wrap-jste] => 1 [wrap-php] => 1 [fix-backslash] => 1 [indent-attributes] => [assume-xml-procins] => [add-xml-space] => [enclose-text] => [enclose-block-text] => [keep-time] => [word-2000] => [tidy-mark] => [gnu-emacs] => [gnu-emacs-file] => [literal-attributes] => [show-body-only] => [fix-uri] => 1 [lower-literals] => 1 [hide-comments] => [indent-cdata] => [force-output] => 1 [show-errors] => 6 [ascii-chars] => 1 [join-classes] => [join-styles] => 1 [escape-cdata] => [language] => [ncr] => 1 [output-bom] => 2 [replace-color] => [css-prefix] => [new-inline-tags] => [new-blocklevel-tags] => [new-empty-tags] => [new-pre-tags] => [accessibility-check] => 0 [vertical-space] => [punctuation-wrap] => [merge-divs] => 1 ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::resetConfig</function></member> <member><function>tidy::saveConfig</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/gethtmlver.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/gethtmlver.xml +++ phpdoc/en/reference/tidy/tidy/gethtmlver.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.gethtmlver" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::htmlver</refname> <refname>tidy_get_html_ver</refname> <refpurpose>Get the Detected HTML version for the specified document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>int</type><methodname>tidy_get_html_ver</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>int</type><methodname>tidy::getHtmlVer</methodname> <void /> </methodsynopsis> <para> Returns the detected HTML version for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the detected HTML version. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return <literal>0</literal>. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getopt.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getopt.xml +++ phpdoc/en/reference/tidy/tidy/getopt.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getopt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::getOpt</refname> <refname>tidy_getopt</refname> <refpurpose>Returns the value of the specified configuration option for the tidy document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>mixed</type><methodname>tidy_getopt</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>option</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>mixed</type><methodname>tidy::getOpt</methodname> <methodparam><type>string</type><parameter>option</parameter></methodparam> </methodsynopsis> <para> Returns the value of the specified <parameter>option</parameter> for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> <para> You will find a list with each configuration option and their types at: <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the value of the specified <parameter>option</parameter>. The return type depends on the type of the specified one. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy_getopt</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html ='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html><head><title>Title</title></head> <body> <p><img src="img.png"></p> </body></html>'; $config = array('accessibility-check' => 3, 'alt-text' => 'some text'); $tidy = new tidy(); $tidy->parseString($html, $config); var_dump($tidy->getOpt('accessibility-check')); //integer var_dump($tidy->getOpt('lower-literals')); //boolean var_dump($tidy->getOpt('alt-text')); //string ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ int(3) bool(true) string(9) "some text" ]]> </screen> </example> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getoptdoc.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getoptdoc.xml +++ phpdoc/en/reference/tidy/tidy/getoptdoc.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getoptdoc" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getoptdoc</refname> <refname>tidy_get_opt_doc</refname> <refpurpose> Returns the documentation for the given option name </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_get_opt_doc</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>optname</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::getOptDoc</methodname> <methodparam><type>string</type><parameter>optname</parameter></methodparam> </methodsynopsis> <para> <function>tidy_get_opt_doc</function> returns the documentation for the given option name. </para> <note> <para> You need at least libtidy from 25 April, 2005 for this function be available. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> <varlistentry> <term><parameter>optname</parameter></term> <listitem> <para> The option name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a string if the option exists and has documentation available, or &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Print all options along with their documentation and default value</title> <programlisting role="php"> <![CDATA[ <?php $tidy = new tidy; $config = $tidy->getConfig(); ksort($config); foreach ($config as $opt => $val) { if (!$doc = $tidy->getOptDoc($opt)) $doc = 'no documentation available!'; $val = ($tidy->getOpt($opt) === true) ? 'true' : $val; $val = ($tidy->getOpt($opt) === false) ? 'false' : $val; echo "<p><b>$opt</b> (default: '$val')<br />". "$doc</p><hr />\n"; } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>tidy::getconfig</function></member> <member><function>tidy::getopt</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getrelease.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getrelease.xml +++ phpdoc/en/reference/tidy/tidy/getrelease.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getrelease" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getRelease</refname> <refname>tidy_get_release</refname> <refpurpose>Get release date (version) for Tidy library</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_get_release</methodname> <void/> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::getRelease</methodname> <void /> </methodsynopsis> <para> Gets the release date of the Tidy library. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a string with the release date of the Tidy library. </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getstatus.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getstatus.xml +++ phpdoc/en/reference/tidy/tidy/getstatus.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getstatus" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getStatus</refname> <refname>tidy_get_status</refname> <refpurpose>Get status of specified document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>int</type><methodname>tidy_get_status</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>int</type><methodname>tidy::getStatus</methodname> <void /> </methodsynopsis> <para> Returns the status for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns 0 if no error/warning was raised, 1 for warnings or accessibility errors, or 2 for errors. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getStatus</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>paragraph</i>'; $tidy = new tidy(); $tidy->parseString($html); $tidy2 = new tidy(); $html2 = '<bogus>test</bogus>'; $tidy2->parseString($html2); echo $tidy->getStatus(); //1 echo $tidy2->getStatus(); //2 ?> ]]> </programlisting> </example> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/head.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/head.xml +++ phpdoc/en/reference/tidy/tidy/head.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.head" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::head</refname> <refname>tidy_get_head</refname> <refpurpose>Returns a tidyNode Object starting from the <head> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_head</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::head</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <head> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::head</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $head = $tidy->head(); echo $head->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <head> <title>test</title> </head> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::body</function></member> <member><function>tidy::html</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/html.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/html.xml +++ phpdoc/en/reference/tidy/tidy/html.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.html" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::html</refname> <refname>tidy_get_html</refname> <refpurpose>Returns a tidyNode Object starting from the <html> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_html</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::html</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <html> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::html</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $html = $tidy::html($tidy); echo $html->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::body</function></member> <member><function>tidy::head</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/isxhtml.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/isxhtml.xml +++ phpdoc/en/reference/tidy/tidy/isxhtml.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.isxhtml" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::isXhtml</refname> <refname>tidy_is_xhtml</refname> <refpurpose>Indicates if the document is a XHTML document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_is_xhtml</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::isXhtml</methodname> <void /> </methodsynopsis> <para> Tells if the document is a XHTML document. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This function returns &true; if the specified tidy <parameter>object</parameter> is a XHTML document, or &false; otherwise. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return &false;. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/isxml.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/isxml.xml +++ phpdoc/en/reference/tidy/tidy/isxml.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.isxml" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::isXml</refname> <refname>tidy_is_xml</refname> <refpurpose>Indicates if the document is a generic (non HTML/XHTML) XML document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_is_xml</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::isXml</methodname> <void /> </methodsynopsis> <para> Tells if the document is a generic (non HTML/XHTML) XML document. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This function returns &true; if the specified tidy <parameter>object</parameter> is a generic XML document (non HTML/XHTML), or &false; otherwise. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return &false;. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/parsefile.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/parsefile.xml +++ phpdoc/en/reference/tidy/tidy/parsefile.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.parsefile" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::parseFile</refname> <refname>tidy_parse_file</refname> <refpurpose>Parse markup in file or URI</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidy</type><methodname>tidy_parse_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::parseFile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para> This function parses the given file. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> If the <parameter>filename</parameter> parameter is given, this function will also read that file and initialize the object with the file, acting like <function>tidy_parse_file</function>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Pour une explication sur chaque option, voyez <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> Le paramètre <parameter>encoding</parameter> configure l'encodage pour les documents d'entrée et de sortie. Les valeurs possibles sont <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal> et <literal>shiftjis</literal>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::parseFile</function> example</title> <programlisting role="php"> <![CDATA[ <?php $tidy = new tidy(); $tidy->parseFile('file.html'); $tidy->cleanRepair(); if(!empty($tidy->errorBuffer)) { echo "The following errors or warnings occured:\n"; echo $tidy->errorBuffer; } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parsestring</function></member> <member><function>tidy::repairfile</function></member> <member><function>tidy::repairstring</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/parsestring.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/parsestring.xml +++ phpdoc/en/reference/tidy/tidy/parsestring.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.parsestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::parseString</refname> <refname>tidy_parse_string</refname> <refpurpose>Parse a document stored in a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidy</type><methodname>tidy_parse_string</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::parseString</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para> Parses a document stored in a string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The data to be parsed. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal>, and <literal>shiftjis</literal>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a new <classname>tidy</classname> instance. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::parseString</function> example</title> <programlisting role="php"> <![CDATA[ <?php ob_start(); ?> <html> <head> <title>test</title> </head> <body> <p>error<br>another line</i> </body> </html> <?php $buffer = ob_get_clean(); $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($buffer, $config, 'UTF8'); $tidy->cleanRepair(); echo $tidy; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> test </title> </head> <body> <p> error<br /> another line </p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::repairFile</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/repairfile.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/repairfile.xml +++ phpdoc/en/reference/tidy/tidy/repairfile.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.repairfile" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::repairFile</refname> <refname>tidy_repair_file</refname> <refpurpose>Repair a file and return it as a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_repair_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::repairFile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para> Repairs the given file and returns it as a string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> The file to be repaired. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Check http://tidy.sourceforge.net/docs/quickref.html for an explanation about each option. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5 and shiftjis. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the repaired contents as a string. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::repairFile</function> example</title> <programlisting role="php"> <![CDATA[ <?php $file = 'file.html'; $tidy = new tidy(); $repaired = $tidy->repairfile($file); rename($file, $file . '.bak'); file_put_contents($file, $repaired); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/repairstring.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/repairstring.xml +++ phpdoc/en/reference/tidy/tidy/repairstring.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.repairstring" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::repairString</refname> <refname>tidy_repair_string</refname> <refpurpose>Repair a string using an optionally provided configuration file</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_repair_string</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::repairString</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para> Repairs the given string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>data</parameter></term> <listitem> <para> The data to be repaired. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Check http://tidy.sourceforge.net/docs/quickref.html for an explanation about each option. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5 and shiftjis. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the repaired string. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::repairString</function> example</title> <programlisting role="php"> <![CDATA[ <?php ob_start(); ?> <html> <head> <title>test</title> </head> <body> <p>error</i> </body> </html> <?php $buffer = ob_get_clean(); $tidy = new tidy(); $clean = $tidy->repairString($buffer); echo $clean; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>test</title> </head> <body> <p>error</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> <member><function>tidy::repairFile</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/root.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/root.xml +++ phpdoc/en/reference/tidy/tidy/root.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.root" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::root</refname> <refname>tidy_get_root</refname> <refpurpose>Returns a tidyNode object representing the root of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_root</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::root</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object representing the root of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::root</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><body> <p>paragraph</p> <br/> </body></html> HTML; $tidy = tidy_parse_string($html); dump_nodes($tidy->root(), 1); function dump_nodes($node, $indent) { if($node->hasChildren()) { foreach($node->child as $child) { echo str_repeat('.', $indent*2) . ($child->name ? $child->name : '"'.$child->value.'"'). "\n"; dump_nodes($child, $indent+1); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[...html.....head.......title.....body.......p........."paragraph".......br ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </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 -->
http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/book.xml?r1=1.3&r2=1.4&diff_format=u Index: phpdoc/en/reference/tidy/book.xml diff -u phpdoc/en/reference/tidy/book.xml:1.3 phpdoc/en/reference/tidy/book.xml:1.4 --- phpdoc/en/reference/tidy/book.xml:1.3 Fri Apr 24 13:20:06 2009 +++ phpdoc/en/reference/tidy/book.xml Sat Apr 25 18:37:20 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.3 $ --> +<!-- $Revision: 1.4 $ --> <book xml:id="book.tidy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Tidy</title> @@ -18,6 +18,7 @@ &reference.tidy.setup; &reference.tidy.constants; &reference.tidy.examples; + &reference.tidy.tidy; &reference.tidy.tidynode; &reference.tidy.reference; http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy.xml +++ phpdoc/en/reference/tidy/tidy.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.tidy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink" xmlns:xi="http://www.w3.org/2001/XInclude"> <title>The <classname>Tidy</classname> class</title> <titleabbrev>Tidy</titleabbrev> <partintro> <!-- {{{ tidy intro --> <section xml:id="tidy.intro"> &reftitle.intro; <para> An HTML node in an HTML file, as detected by tidy. </para> </section> <!-- }}} --> <section xml:id="tidy.synopsis"> &reftitle.classsynopsis; <!-- {{{ Synopsis --> <classsynopsis> <ooclass><classname>Tidy</classname></ooclass> <!-- {{{ Class synopsis --> <classsynopsisinfo> <ooclass> <classname>Tidy</classname> </ooclass> </classsynopsisinfo> <!-- }}} --> <classsynopsisinfo role="comment">Properties</classsynopsisinfo> <classsynopsisinfo role="comment">Methods</classsynopsisinfo> <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('class.tidy')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> </classsynopsis> <!-- }}} --> </section> <!-- {{{ Tidy properties --> <section xml:id="tidy.props"> &reftitle.properties; <variablelist> <varlistentry xml:id="tidy.props.body"> <term><varname>errorBuffer</varname></term> <listitem> <para> The last warnings and errors from TidyLib </para> </listitem> </varlistentry> </variablelist> <!-- <para> <informaltable> <tgroup cols="2"> <thead> <row> <entry>&Version;</entry> <entry>&Description;</entry> </row> </thead> <tbody> <row> <entry>5.1.0</entry> <entry><varname>line</varname>, <varname>column</varname> and <varname>proprietary</varname> were added</entry> </row> </tbody> </tgroup> </informaltable> </para> --> </section> <!-- }}} --> </partintro> &reference.tidy.entities.tidy; </phpdoc:classref> <!-- 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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/body.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/body.xml +++ phpdoc/en/reference/tidy/tidy/body.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.body" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::body</refname> <refname>tidy_get_body</refname> <refpurpose>Returns a tidyNode Object starting from the <body> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_body</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::body</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <body> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the detected HTML version. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return <literal>0</literal>. </para> </warning> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getBody</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $body = $tidy->Body(); echo $body->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <body> <p>paragraph</p> </body> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::head</function></member> <member><function>tidy::html</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/cleanrepair.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/cleanrepair.xml +++ phpdoc/en/reference/tidy/tidy/cleanrepair.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.cleanrepair" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::CleanRepair</refname> <refname>tidy_clean_repair</refname> <refpurpose>Execute configured cleanup and repair operations on parsed markup</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_clean_repair</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::cleanRepair</methodname> <void /> </methodsynopsis> <para> This function cleans and repairs the given tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::cleanrepair</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>test</I>'; $tidy = tidy_parse_string($html); $tidy->CleanRepair(); echo $tidy; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title></title> </head> <body> <p>test</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::repairFile</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/construct.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/construct.xml +++ phpdoc/en/reference/tidy/tidy/construct.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.construct" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::__construct</refname> <refpurpose>Constructs a new <classname>tidy</classname> object</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>tidy</type><methodname>tidy::__construct</methodname> <methodparam choice="opt"><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter></methodparam> </methodsynopsis> <para> Constructs a new <classname>tidy</classname> object. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> If the <parameter>filename</parameter> parameter is given, this function will also read that file and initialize the object with the file, acting like <function>tidy_parse_file</function>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal>, and <literal>shiftjis</literal>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the new <classname>tidy</classname> instance. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::__construct</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"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head><title>title</title></head> <body> <p>paragraph <bt /> text</p> </body></html> HTML; $tidy = new tidy(); $tidy->ParseString($html); $tidy->CleanRepair(); if ($tidy->errorBuffer) { echo "The following errors were detected:\n"; echo $tidy->errorBuffer; } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ The following errors were detected: line 8 column 14 - Error: <bt> is not recognized! line 8 column 14 - Warning: discarding unexpected <bt> ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/diagnose.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/diagnose.xml +++ phpdoc/en/reference/tidy/tidy/diagnose.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidy-diagnose" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::diagnose</refname> <refname>tidy_diagnose</refname> <refpurpose>Run configured diagnostics on parsed and repaired markup</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <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> Runs diagnostic tests on the given tidy <parameter>object</parameter>, adding some more information about the document in the error buffer. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <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->errorBuffer . "\n"; $tidy->diagnose(); echo $tidy->errorBuffer; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ line 4 column 1 - Warning: <p> isn't allowed in <head> elements line 4 column 1 - Warning: inserting missing 'title' element line 4 column 1 - Warning: <p> isn't allowed in <head> elements line 4 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> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::errorBuffer</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getconfig.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getconfig.xml +++ phpdoc/en/reference/tidy/tidy/getconfig.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getconfig" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::getConfig</refname> <refname>tidy_get_config</refname> <refpurpose>Get current Tidy configuration</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>array</type><methodname>tidy_get_config</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>array</type><methodname>tidy::getConfig</methodname> <void /> </methodsynopsis> <para> Gets the list of the configuration options in use by the given tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns an array of configuration options. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getConfig</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>test</p>'; $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($html, $config); print_r($tidy->getConfig()); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ Array ( [indent-spaces] => 2 [wrap] => 200 [tab-size] => 8 [char-encoding] => 1 [input-encoding] => 3 [output-encoding] => 1 [newline] => 1 [doctype-mode] => 1 [doctype] => [repeated-attributes] => 1 [alt-text] => [slide-style] => [error-file] => [output-file] => [write-back] => [markup] => 1 [show-warnings] => 1 [quiet] => [indent] => 1 [hide-endtags] => [input-xml] => [output-xml] => 1 [output-xhtml] => 1 [output-html] => [add-xml-decl] => [uppercase-tags] => [uppercase-attributes] => [bare] => [clean] => [logical-emphasis] => [drop-proprietary-attributes] => [drop-font-tags] => [drop-empty-paras] => 1 [fix-bad-comments] => 1 [break-before-br] => [split] => [numeric-entities] => [quote-marks] => [quote-nbsp] => 1 [quote-ampersand] => 1 [wrap-attributes] => [wrap-script-literals] => [wrap-sections] => 1 [wrap-asp] => 1 [wrap-jste] => 1 [wrap-php] => 1 [fix-backslash] => 1 [indent-attributes] => [assume-xml-procins] => [add-xml-space] => [enclose-text] => [enclose-block-text] => [keep-time] => [word-2000] => [tidy-mark] => [gnu-emacs] => [gnu-emacs-file] => [literal-attributes] => [show-body-only] => [fix-uri] => 1 [lower-literals] => 1 [hide-comments] => [indent-cdata] => [force-output] => 1 [show-errors] => 6 [ascii-chars] => 1 [join-classes] => [join-styles] => 1 [escape-cdata] => [language] => [ncr] => 1 [output-bom] => 2 [replace-color] => [css-prefix] => [new-inline-tags] => [new-blocklevel-tags] => [new-empty-tags] => [new-pre-tags] => [accessibility-check] => 0 [vertical-space] => [punctuation-wrap] => [merge-divs] => 1 ) ]]> </screen> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::resetConfig</function></member> <member><function>tidy::saveConfig</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/gethtmlver.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/gethtmlver.xml +++ phpdoc/en/reference/tidy/tidy/gethtmlver.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.gethtmlver" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::htmlver</refname> <refname>tidy_get_html_ver</refname> <refpurpose>Get the Detected HTML version for the specified document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>int</type><methodname>tidy_get_html_ver</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>int</type><methodname>tidy::getHtmlVer</methodname> <void /> </methodsynopsis> <para> Returns the detected HTML version for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the detected HTML version. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return <literal>0</literal>. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getopt.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getopt.xml +++ phpdoc/en/reference/tidy/tidy/getopt.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getopt" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::getOpt</refname> <refname>tidy_getopt</refname> <refpurpose>Returns the value of the specified configuration option for the tidy document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>mixed</type><methodname>tidy_getopt</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>option</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>mixed</type><methodname>tidy::getOpt</methodname> <methodparam><type>string</type><parameter>option</parameter></methodparam> </methodsynopsis> <para> Returns the value of the specified <parameter>option</parameter> for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> <varlistentry> <term><parameter>option</parameter></term> <listitem> <para> You will find a list with each configuration option and their types at: <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the value of the specified <parameter>option</parameter>. The return type depends on the type of the specified one. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy_getopt</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html ='<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html><head><title>Title</title></head> <body> <p><img src="img.png"></p> </body></html>'; $config = array('accessibility-check' => 3, 'alt-text' => 'some text'); $tidy = new tidy(); $tidy->parseString($html, $config); var_dump($tidy->getOpt('accessibility-check')); //integer var_dump($tidy->getOpt('lower-literals')); //boolean var_dump($tidy->getOpt('alt-text')); //string ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ int(3) bool(true) string(9) "some text" ]]> </screen> </example> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getoptdoc.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getoptdoc.xml +++ phpdoc/en/reference/tidy/tidy/getoptdoc.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getoptdoc" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getoptdoc</refname> <refname>tidy_get_opt_doc</refname> <refpurpose> Returns the documentation for the given option name </refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_get_opt_doc</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> <methodparam><type>string</type><parameter>optname</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::getOptDoc</methodname> <methodparam><type>string</type><parameter>optname</parameter></methodparam> </methodsynopsis> <para> <function>tidy_get_opt_doc</function> returns the documentation for the given option name. </para> <note> <para> You need at least libtidy from 25 April, 2005 for this function be available. </para> </note> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> <varlistentry> <term><parameter>optname</parameter></term> <listitem> <para> The option name </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a string if the option exists and has documentation available, or &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Print all options along with their documentation and default value</title> <programlisting role="php"> <![CDATA[ <?php $tidy = new tidy; $config = $tidy->getConfig(); ksort($config); foreach ($config as $opt => $val) { if (!$doc = $tidy->getOptDoc($opt)) $doc = 'no documentation available!'; $val = ($tidy->getOpt($opt) === true) ? 'true' : $val; $val = ($tidy->getOpt($opt) === false) ? 'false' : $val; echo "<p><b>$opt</b> (default: '$val')<br />". "$doc</p><hr />\n"; } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <para> <simplelist> <member><function>tidy::getconfig</function></member> <member><function>tidy::getopt</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getrelease.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getrelease.xml +++ phpdoc/en/reference/tidy/tidy/getrelease.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getrelease" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getRelease</refname> <refname>tidy_get_release</refname> <refpurpose>Get release date (version) for Tidy library</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_get_release</methodname> <void/> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::getRelease</methodname> <void /> </methodsynopsis> <para> Gets the release date of the Tidy library. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a string with the release date of the Tidy library. </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/getstatus.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/getstatus.xml +++ phpdoc/en/reference/tidy/tidy/getstatus.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.getstatus" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::getStatus</refname> <refname>tidy_get_status</refname> <refpurpose>Get status of specified document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>int</type><methodname>tidy_get_status</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>int</type><methodname>tidy::getStatus</methodname> <void /> </methodsynopsis> <para> Returns the status for the specified tidy <parameter>object</parameter>. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns 0 if no error/warning was raised, 1 for warnings or accessibility errors, or 2 for errors. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::getStatus</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = '<p>paragraph</i>'; $tidy = new tidy(); $tidy->parseString($html); $tidy2 = new tidy(); $html2 = '<bogus>test</bogus>'; $tidy2->parseString($html2); echo $tidy->getStatus(); //1 echo $tidy2->getStatus(); //2 ?> ]]> </programlisting> </example> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/head.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/head.xml +++ phpdoc/en/reference/tidy/tidy/head.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.head" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::head</refname> <refname>tidy_get_head</refname> <refpurpose>Returns a tidyNode Object starting from the <head> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_head</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::head</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <head> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::head</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $head = $tidy->head(); echo $head->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <head> <title>test</title> </head> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::body</function></member> <member><function>tidy::html</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/html.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/html.xml +++ phpdoc/en/reference/tidy/tidy/html.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.html" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::html</refname> <refname>tidy_get_html</refname> <refpurpose>Returns a tidyNode Object starting from the <html> tag of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_html</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::html</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object starting from the <html> tag of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::html</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = ' <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html>'; $tidy = tidy_parse_string($html); $html = $tidy::html($tidy); echo $html->value; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <html> <head> <title>test</title> </head> <body> <p>paragraph</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::body</function></member> <member><function>tidy::head</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/isxhtml.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/isxhtml.xml +++ phpdoc/en/reference/tidy/tidy/isxhtml.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.isxhtml" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::isXhtml</refname> <refname>tidy_is_xhtml</refname> <refpurpose>Indicates if the document is a XHTML document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_is_xhtml</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::isXhtml</methodname> <void /> </methodsynopsis> <para> Tells if the document is a XHTML document. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This function returns &true; if the specified tidy <parameter>object</parameter> is a XHTML document, or &false; otherwise. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return &false;. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/isxml.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/isxml.xml +++ phpdoc/en/reference/tidy/tidy/isxml.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.isxml" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::isXml</refname> <refname>tidy_is_xml</refname> <refpurpose>Indicates if the document is a generic (non HTML/XHTML) XML document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>bool</type><methodname>tidy_is_xml</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::isXml</methodname> <void /> </methodsynopsis> <para> Tells if the document is a generic (non HTML/XHTML) XML document. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> This function returns &true; if the specified tidy <parameter>object</parameter> is a generic XML document (non HTML/XHTML), or &false; otherwise. </para> <warning> <para> This function is not yet implemented in the Tidylib itself, so it always return &false;. </para> </warning> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/parsefile.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/parsefile.xml +++ phpdoc/en/reference/tidy/tidy/parsefile.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.parsefile" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::parseFile</refname> <refname>tidy_parse_file</refname> <refpurpose>Parse markup in file or URI</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidy</type><methodname>tidy_parse_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::parseFile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para> This function parses the given file. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> If the <parameter>filename</parameter> parameter is given, this function will also read that file and initialize the object with the file, acting like <function>tidy_parse_file</function>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Pour une explication sur chaque option, voyez <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> Le paramètre <parameter>encoding</parameter> configure l'encodage pour les documents d'entrée et de sortie. Les valeurs possibles sont <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal> et <literal>shiftjis</literal>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> &return.success; </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::parseFile</function> example</title> <programlisting role="php"> <![CDATA[ <?php $tidy = new tidy(); $tidy->parseFile('file.html'); $tidy->cleanRepair(); if(!empty($tidy->errorBuffer)) { echo "The following errors or warnings occured:\n"; echo $tidy->errorBuffer; } ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parsestring</function></member> <member><function>tidy::repairfile</function></member> <member><function>tidy::repairstring</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/parsestring.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/parsestring.xml +++ phpdoc/en/reference/tidy/tidy/parsestring.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.parsestring" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <refnamediv> <refname>tidy::parseString</refname> <refname>tidy_parse_string</refname> <refpurpose>Parse a document stored in a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidy</type><methodname>tidy_parse_string</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>bool</type><methodname>tidy::parseString</methodname> <methodparam><type>string</type><parameter>input</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para> Parses a document stored in a string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>input</parameter></term> <listitem> <para> The data to be parsed. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> For an explanation about each option, visit <link xlink:href="&url.tidy.conf;">&url.tidy.conf;</link>. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: <literal>ascii</literal>, <literal>latin0</literal>, <literal>latin1</literal>, <literal>raw</literal>, <literal>utf8</literal>, <literal>iso2022</literal>, <literal>mac</literal>, <literal>win1252</literal>, <literal>ibm858</literal>, <literal>utf16</literal>, <literal>utf16le</literal>, <literal>utf16be</literal>, <literal>big5</literal>, and <literal>shiftjis</literal>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a new <classname>tidy</classname> instance. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::parseString</function> example</title> <programlisting role="php"> <![CDATA[ <?php ob_start(); ?> <html> <head> <title>test</title> </head> <body> <p>error<br>another line</i> </body> </html> <?php $buffer = ob_get_clean(); $config = array('indent' => TRUE, 'output-xhtml' => TRUE, 'wrap' => 200); $tidy = tidy_parse_string($buffer, $config, 'UTF8'); $tidy->cleanRepair(); echo $tidy; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title> test </title> </head> <body> <p> error<br /> another line </p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::repairFile</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/repairfile.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/repairfile.xml +++ phpdoc/en/reference/tidy/tidy/repairfile.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.repairfile" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::repairFile</refname> <refname>tidy_repair_file</refname> <refpurpose>Repair a file and return it as a string</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_repair_file</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::repairFile</methodname> <methodparam><type>string</type><parameter>filename</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> <methodparam choice="opt"><type>bool</type><parameter>use_include_path</parameter><initializer>false</initializer></methodparam> </methodsynopsis> <para> Repairs the given file and returns it as a string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>filename</parameter></term> <listitem> <para> The file to be repaired. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Check http://tidy.sourceforge.net/docs/quickref.html for an explanation about each option. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5 and shiftjis. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>use_include_path</parameter></term> <listitem> <para> Search for the file in the <link linkend="ini.include-path">include_path</link>. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the repaired contents as a string. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::repairFile</function> example</title> <programlisting role="php"> <![CDATA[ <?php $file = 'file.html'; $tidy = new tidy(); $repaired = $tidy->repairfile($file); rename($file, $file . '.bak'); file_put_contents($file, $repaired); ?> ]]> </programlisting> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> <member><function>tidy::repairString</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/repairstring.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/repairstring.xml +++ phpdoc/en/reference/tidy/tidy/repairstring.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.repairstring" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::repairString</refname> <refname>tidy_repair_string</refname> <refpurpose>Repair a string using an optionally provided configuration file</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>string</type><methodname>tidy_repair_string</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>string</type><methodname>tidy::repairString</methodname> <methodparam><type>string</type><parameter>data</parameter></methodparam> <methodparam choice="opt"><type>mixed</type><parameter>config</parameter></methodparam> <methodparam choice="opt"><type>string</type><parameter>encoding</parameter></methodparam> </methodsynopsis> <para> Repairs the given string. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>data</parameter></term> <listitem> <para> The data to be repaired. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>config</parameter></term> <listitem> <para> The config <parameter>config</parameter> can be passed either as an array or as a string. If a string is passed, it is interpreted as the name of the configuration file, otherwise, it is interpreted as the options themselves. </para> <para> Check http://tidy.sourceforge.net/docs/quickref.html for an explanation about each option. </para> </listitem> </varlistentry> <varlistentry> <term><parameter>encoding</parameter></term> <listitem> <para> The <parameter>encoding</parameter> parameter sets the encoding for input/output documents. The possible values for encoding are: ascii, latin0, latin1, raw, utf8, iso2022, mac, win1252, ibm858, utf16, utf16le, utf16be, big5 and shiftjis. </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the repaired string. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::repairString</function> example</title> <programlisting role="php"> <![CDATA[ <?php ob_start(); ?> <html> <head> <title>test</title> </head> <body> <p>error</i> </body> </html> <?php $buffer = ob_get_clean(); $tidy = new tidy(); $clean = $tidy->repairString($buffer); echo $clean; ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title>test</title> </head> <body> <p>error</p> </body> </html> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.2only; </refsect1> <refsect1 role="seealso"> &reftitle.seealso; <simplelist> <member><function>tidy::parseFile</function></member> <member><function>tidy::parseString</function></member> <member><function>tidy::repairFile</function></member> </simplelist> </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 --> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidy/root.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidy/root.xml +++ phpdoc/en/reference/tidy/tidy/root.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="tidy.root" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidy::root</refname> <refname>tidy_get_root</refname> <refpurpose>Returns a tidyNode object representing the root of the tidy parse tree</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <para>Procedural style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy_get_root</methodname> <methodparam><type>tidy</type><parameter>object</parameter></methodparam> </methodsynopsis> <para>Object oriented style</para> <methodsynopsis> <type>tidyNode</type><methodname>tidy::root</methodname> <void /> </methodsynopsis> <para> Returns a <classname>tidyNode</classname> object representing the root of the tidy parse tree. </para> </refsect1> <refsect1 role="parameters"> &reftitle.parameters; <para> <variablelist> <varlistentry> <term><parameter>object</parameter></term> <listitem> <para> &tidy.object; </para> </listitem> </varlistentry> </variablelist> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns the <classname>tidyNode</classname> object. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title><function>tidy::root</function> example</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><body> <p>paragraph</p> <br/> </body></html> HTML; $tidy = tidy_parse_string($html); dump_nodes($tidy->root(), 1); function dump_nodes($node, $indent) { if($node->hasChildren()) { foreach($node->child as $child) { echo str_repeat('.', $indent*2) . ($child->name ? $child->name : '"'.$child->value.'"'). "\n"; dump_nodes($child, $indent+1); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[...html.....head.......title.....body.......p........."paragraph".......br ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; ¬e.tidy.ze2; </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 -->