<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >Tidy Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Referência das Funções" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="tcpwrap_check" HREF="function.tcpwrap-check.html"><LINK REL="NEXT" TITLE="ob_tidyhandler" HREF="function.ob-tidyhandler.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.tcpwrap-check.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="function.ob-tidyhandler.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.tidy" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CLXVI. Tidy Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN226723" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.intro" >Introdução</A ></H1 ><P > Tidy is a binding for the Tidy HTML clean and repair utility which allows you to not only clean and otherwise manipulate HTML documents, but also traverse the document tree. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.requirements" >Dependências</A ></H1 ><P > To use Tidy, you will need libtidy installed, available on the tidy homepage <A HREF="http://tidy.sourceforge.net/" TARGET="_top" >http://tidy.sourceforge.net/</A >. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.installation" >Instalação</A ></H1 ><P > Tidy is currently available for PHP 4.3.x and PHP 5 as a PECL extension from <A HREF="http://pecl.php.net/package/tidy" TARGET="_top" >http://pecl.php.net/package/tidy</A >. </P ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > Tidy 1.0 is just for PHP 4.3.x, while Tidy 2.0 is just for PHP 5. </P ></BLOCKQUOTE ></DIV ><P > If <A HREF="http://pear.php.net/" TARGET="_top" >PEAR</A > is available on your *nix-like system you can use the pear installer to install the tidy extension, by the following command: <B CLASS="command" >pecl install tidy</B >. </P ><P > You can always download the tar.gz package and install tidy by hand: <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN226741" ></A ><P ><B >Exemplo 1. tidy install by hand in PHP 4.3.x</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><PRE CLASS="shell" >gunzip tidy-xxx.tgz tar -xvf tidy-xxx.tar cd tidy-xxx phpize ./configure && make && make install</PRE ></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ><P > Windows users can download the extension dll from <A HREF="http://pecl4win.php.net/ext.php/php_tidy.dll" TARGET="_top" >http://pecl4win.php.net/ext.php/php_tidy.dll</A >. </P ><P > In PHP 5 you need only to compile using the <CODE CLASS="option" >--with-tidy</CODE > option. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.configuration" >Configurações em execução</A ></H1 ><P > O comportamento dessas funções podem ser modificado pelas configurações do <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN226753" ></A ><P ><B >Tabela 1. Tidy Configuration Options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Default</TH ><TH >Changeable</TH ><TH >Changelog</TH ></TR ></THEAD ><TBODY ><TR ><TD >tidy.default_config</TD ><TD >""</TD ><TD >PHP_INI_SYSTEM</TD ><TD >Available since PHP 5.0.0.</TD ></TR ><TR ><TD >tidy.clean_output</TD ><TD >"0"</TD ><TD >PHP_INI_PERDIR</TD ><TD >Available since PHP 5.0.0.</TD ></TR ></TBODY ></TABLE ></DIV > Para mais detalhes e definições das constantes PHP_INI_*, veja <A HREF="ini.html" >Apêndice H</A >. </P ><P >Breve descrição das diretivas de configuração.</P ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.tidy.default-config" ></A ><CODE CLASS="parameter" >tidy.default_config</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Default path for tidy config file. </P ></DD ><DT ><A NAME="ini.tidy.clean-output" ></A ><CODE CLASS="parameter" >tidy.clean_output</CODE > <A HREF="language.types.boolean.html" ><B CLASS="type" >boolean</B ></A ></DT ><DD ><P > Turns on/off the output repairing by Tidy. </P ><DIV CLASS="warning" ><P ></P ><TABLE CLASS="warning" BORDER="1" WIDTH="100%" ><TR ><TD ALIGN="CENTER" ><B >Atenção</B ></TD ></TR ><TR ><TD ALIGN="LEFT" ><P > Do not turn on <TT CLASS="literal" >tidy.clean_output</TT > if you are generating non-html content such as dynamic images. </P ></TD ></TR ></TABLE ></DIV ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.resources" >Tipos Resource</A ></H1 ><P >Esta extensão não possui nenhum tipo resource.</P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.classes" >Classes pré-definidas</A ></H1 ><DIV CLASS="section" ><H2 CLASS="section" ><A NAME="tidy.class.tidynode" ><B CLASS="classname" >tidyNode</B ></A ></H2 ><DIV CLASS="section" ><H3 CLASS="section" ><A NAME="tidy.class.tidynode.methods" >Métodos</A ></H3 ><P ></P ><UL ><LI ><P ><A HREF="function.tidynode-getparent.html" >tidyNode::getParent</A > - Returns the parent of the current node</P ></LI ><LI ><P ><A HREF="function.tidynode-haschildren.html" >tidyNode->hasChildren</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node has children</P ></LI ><LI ><P ><A HREF="function.tidynode-hassiblings.html" >tidyNode->hasSiblings</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node has siblings</P ></LI ><LI ><P ><A HREF="function.tidynode-isasp.html" >tidyNode->isAsp</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is ASP code</P ></LI ><LI ><P ><A HREF="function.tidynode-iscomment.html" >tidyNode->isComment</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is a comment</P ></LI ><LI ><P ><A HREF="function.tidynode-ishtml.html" >tidyNode->isHtml</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is HTML</P ></LI ><LI ><P ><A HREF="function.tidynode-isjste.html" >tidyNode->isJste</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is JSTE</P ></LI ><LI ><P ><A HREF="function.tidynode-isphp.html" >tidyNode->isPhp</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is PHP</P ></LI ><LI ><P ><A HREF="function.tidynode-istext.html" >tidyNode->isText</A > - Returns <TT CLASS="constant" ><B >TRUE</B ></TT > if the current node is Text (no markup)</P ></LI ></UL ></DIV ><DIV CLASS="section" ><H3 CLASS="section" ><A NAME="tidy.class.tidynode.properties" >Propriedades</A ></H3 ><P ></P ><UL ><LI ><P >value - the value of the node (e.g. the html text)</P ></LI ><LI ><P >name - the name of the tag (e.g. html, a, etc..)</P ></LI ><LI ><P >type - the type of the node (one of the constants above, e.g. <TT CLASS="constant" ><B >TIDY_NODETYPE_PHP</B ></TT >)</P ></LI ><LI ><P >line* - the line where the node starts</P ></LI ><LI ><P >column* - the column where the node starts</P ></LI ><LI ><P >proprietary* - <TT CLASS="constant" ><B >TRUE</B ></TT > if the node refers to a proprietary tag</P ></LI ><LI ><P >id - the ID of the tag (one of the constants above, e.g. <TT CLASS="constant" ><B >TIDY_TAG_FRAME</B ></TT >)</P ></LI ><LI ><P >attribute - an array with the attributes of the current node, or <TT CLASS="constant" ><B >NULL</B ></TT > if there aren't any</P ></LI ><LI ><P >child - an array with the child tidyNodes, or <TT CLASS="constant" ><B >NULL</B ></TT > if there aren't any</P ></LI ></UL ><DIV CLASS="note" ><BLOCKQUOTE CLASS="note" ><P ><B >Nota: </B > The properties marked with * are just available since PHP 5.1.0. </P ></BLOCKQUOTE ></DIV ></DIV ></DIV ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.constants" >Constantes pré-definidas</A ></H1 ><P > As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução. </P ><P > Each <TT CLASS="literal" >TIDY_TAG_XXX</TT > represents a HTML tag. For example, <TT CLASS="constant" ><B >TIDY_TAG_A</B ></TT > represents a <a href="XX">link</a> tag. Each <TT CLASS="literal" >TIDY_ATTR_XXX</TT > represents a HTML atribute. For example <TT CLASS="constant" ><B >TIDY_ATTR_HREF</B ></TT > would represent the href atribute in the previous example. </P ><P > The following constants are defined: <DIV CLASS="table" ><A NAME="AEN226876" ></A ><P ><B >Tabela 2. tidy tag constants</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><THEAD ><TR ><TH >constant</TH ></TR ></THEAD ><TBODY ><TR ><TD >TIDY_TAG_UNKNOWN</TD ></TR ><TR ><TD >TIDY_TAG_A</TD ></TR ><TR ><TD >TIDY_TAG_ABBR</TD ></TR ><TR ><TD >TIDY_TAG_ACRONYM</TD ></TR ><TR ><TD >TIDY_TAG_ALIGN</TD ></TR ><TR ><TD >TIDY_TAG_APPLET</TD ></TR ><TR ><TD >TIDY_TAG_AREA</TD ></TR ><TR ><TD >TIDY_TAG_B</TD ></TR ><TR ><TD >TIDY_TAG_BASE</TD ></TR ><TR ><TD >TIDY_TAG_BASEFONT</TD ></TR ><TR ><TD >TIDY_TAG_BDO</TD ></TR ><TR ><TD >TIDY_TAG_BGSOUND</TD ></TR ><TR ><TD >TIDY_TAG_BIG</TD ></TR ><TR ><TD >TIDY_TAG_BLINK</TD ></TR ><TR ><TD >TIDY_TAG_BLOCKQUOTE</TD ></TR ><TR ><TD >TIDY_TAG_BODY</TD ></TR ><TR ><TD >TIDY_TAG_BR</TD ></TR ><TR ><TD >TIDY_TAG_BUTTON</TD ></TR ><TR ><TD >TIDY_TAG_CAPTION</TD ></TR ><TR ><TD >TIDY_TAG_CENTER</TD ></TR ><TR ><TD >TIDY_TAG_CITE</TD ></TR ><TR ><TD >TIDY_TAG_CODE</TD ></TR ><TR ><TD >TIDY_TAG_COL</TD ></TR ><TR ><TD >TIDY_TAG_COLGROUP</TD ></TR ><TR ><TD >TIDY_TAG_COMMENT</TD ></TR ><TR ><TD >TIDY_TAG_DD</TD ></TR ><TR ><TD >TIDY_TAG_DEL</TD ></TR ><TR ><TD >TIDY_TAG_DFN</TD ></TR ><TR ><TD >TIDY_TAG_DIR</TD ></TR ><TR ><TD >TIDY_TAG_DIV</TD ></TR ><TR ><TD >TIDY_TAG_DL</TD ></TR ><TR ><TD >TIDY_TAG_DT</TD ></TR ><TR ><TD >TIDY_TAG_EM</TD ></TR ><TR ><TD >TIDY_TAG_EMBED</TD ></TR ><TR ><TD >TIDY_TAG_FIELDSET</TD ></TR ><TR ><TD >TIDY_TAG_FONT</TD ></TR ><TR ><TD >TIDY_TAG_FORM</TD ></TR ><TR ><TD >TIDY_TAG_FRAME</TD ></TR ><TR ><TD >TIDY_TAG_FRAMESET</TD ></TR ><TR ><TD >TIDY_TAG_H1</TD ></TR ><TR ><TD >TIDY_TAG_H2</TD ></TR ><TR ><TD >TIDY_TAG_H3</TD ></TR ><TR ><TD >TIDY_TAG_H4</TD ></TR ><TR ><TD >TIDY_TAG_H5</TD ></TR ><TR ><TD >TIDY_TAG_H6</TD ></TR ><TR ><TD >TIDY_TAG_HEAD</TD ></TR ><TR ><TD >TIDY_TAG_HR</TD ></TR ><TR ><TD >TIDY_TAG_HTML</TD ></TR ><TR ><TD >TIDY_TAG_I</TD ></TR ><TR ><TD >TIDY_TAG_IFRAME</TD ></TR ><TR ><TD >TIDY_TAG_ILAYER</TD ></TR ><TR ><TD >TIDY_TAG_IMG</TD ></TR ><TR ><TD >TIDY_TAG_INPUT</TD ></TR ><TR ><TD >TIDY_TAG_INS</TD ></TR ><TR ><TD >TIDY_TAG_ISINDEX</TD ></TR ><TR ><TD >TIDY_TAG_KBD</TD ></TR ><TR ><TD >TIDY_TAG_KEYGEN</TD ></TR ><TR ><TD >TIDY_TAG_LABEL</TD ></TR ><TR ><TD >TIDY_TAG_LAYER</TD ></TR ><TR ><TD >TIDY_TAG_LEGEND</TD ></TR ><TR ><TD >TIDY_TAG_LI</TD ></TR ><TR ><TD >TIDY_TAG_LINK</TD ></TR ><TR ><TD >TIDY_TAG_LISTING</TD ></TR ><TR ><TD >TIDY_TAG_MAP</TD ></TR ><TR ><TD >TIDY_TAG_MARQUEE</TD ></TR ><TR ><TD >TIDY_TAG_MENU</TD ></TR ><TR ><TD >TIDY_TAG_META</TD ></TR ><TR ><TD >TIDY_TAG_MULTICOL</TD ></TR ><TR ><TD >TIDY_TAG_NOBR</TD ></TR ><TR ><TD >TIDY_TAG_NOEMBED</TD ></TR ><TR ><TD >TIDY_TAG_NOFRAMES</TD ></TR ><TR ><TD >TIDY_TAG_NOLAYER</TD ></TR ><TR ><TD >TIDY_TAG_NOSAVE</TD ></TR ><TR ><TD >TIDY_TAG_NOSCRIPT</TD ></TR ><TR ><TD >TIDY_TAG_OBJECT</TD ></TR ><TR ><TD >TIDY_TAG_OL</TD ></TR ><TR ><TD >TIDY_TAG_OPTGROUP</TD ></TR ><TR ><TD >TIDY_TAG_OPTION</TD ></TR ><TR ><TD >TIDY_TAG_P</TD ></TR ><TR ><TD >TIDY_TAG_PARAM</TD ></TR ><TR ><TD >TIDY_TAG_PLAINTEXT</TD ></TR ><TR ><TD >TIDY_TAG_PRE</TD ></TR ><TR ><TD >TIDY_TAG_Q</TD ></TR ><TR ><TD >TIDY_TAG_RP</TD ></TR ><TR ><TD >TIDY_TAG_RT</TD ></TR ><TR ><TD >TIDY_TAG_RTC</TD ></TR ><TR ><TD >TIDY_TAG_RUBY</TD ></TR ><TR ><TD >TIDY_TAG_S</TD ></TR ><TR ><TD >TIDY_TAG_SAMP</TD ></TR ><TR ><TD >TIDY_TAG_SCRIPT</TD ></TR ><TR ><TD >TIDY_TAG_SELECT</TD ></TR ><TR ><TD >TIDY_TAG_SERVER</TD ></TR ><TR ><TD >TIDY_TAG_SERVLET</TD ></TR ><TR ><TD >TIDY_TAG_SMALL</TD ></TR ><TR ><TD >TIDY_TAG_SPACER</TD ></TR ><TR ><TD >TIDY_TAG_SPAN</TD ></TR ><TR ><TD >TIDY_TAG_STRIKE</TD ></TR ><TR ><TD >TIDY_TAG_STRONG</TD ></TR ><TR ><TD >TIDY_TAG_STYLE</TD ></TR ><TR ><TD >TIDY_TAG_SUB</TD ></TR ><TR ><TD >TIDY_TAG_TABLE</TD ></TR ><TR ><TD >TIDY_TAG_TBODY</TD ></TR ><TR ><TD >TIDY_TAG_TD</TD ></TR ><TR ><TD >TIDY_TAG_TEXTAREA</TD ></TR ><TR ><TD >TIDY_TAG_TFOOT</TD ></TR ><TR ><TD >TIDY_TAG_TH</TD ></TR ><TR ><TD >TIDY_TAG_THEAD</TD ></TR ><TR ><TD >TIDY_TAG_TITLE</TD ></TR ><TR ><TD >TIDY_TAG_TR</TD ></TR ><TR ><TD >TIDY_TAG_TR</TD ></TR ><TR ><TD >TIDY_TAG_TT</TD ></TR ><TR ><TD >TIDY_TAG_U</TD ></TR ><TR ><TD >TIDY_TAG_UL</TD ></TR ><TR ><TD >TIDY_TAG_VAR</TD ></TR ><TR ><TD >TIDY_TAG_WBR</TD ></TR ><TR ><TD >TIDY_TAG_XMP</TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > <DIV CLASS="table" ><A NAME="AEN227116" ></A ><P ><B >Tabela 3. tidy attribute constants</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><THEAD ><TR ><TH >constant</TH ></TR ></THEAD ><TBODY ><TR ><TD >TIDY_ATTR_UNKNOWN</TD ></TR ><TR ><TD >TIDY_ATTR_ABBR</TD ></TR ><TR ><TD >TIDY_ATTR_ACCEPT</TD ></TR ><TR ><TD >TIDY_ATTR_ACCEPT_CHARSET</TD ></TR ><TR ><TD >TIDY_ATTR_ACCESSKEY</TD ></TR ><TR ><TD >TIDY_ATTR_ACTION</TD ></TR ><TR ><TD >TIDY_ATTR_ADD_DATE</TD ></TR ><TR ><TD >TIDY_ATTR_ALIGN</TD ></TR ><TR ><TD >TIDY_ATTR_ALINK</TD ></TR ><TR ><TD >TIDY_ATTR_ALT</TD ></TR ><TR ><TD >TIDY_ATTR_ARCHIVE</TD ></TR ><TR ><TD >TIDY_ATTR_AXIS</TD ></TR ><TR ><TD >TIDY_ATTR_BACKGROUND</TD ></TR ><TR ><TD >TIDY_ATTR_BGCOLOR</TD ></TR ><TR ><TD >TIDY_ATTR_BGPROPERTIES</TD ></TR ><TR ><TD >TIDY_ATTR_BORDER</TD ></TR ><TR ><TD >TIDY_ATTR_BORDERCOLOR</TD ></TR ><TR ><TD >TIDY_ATTR_BOTTOMMARGIN</TD ></TR ><TR ><TD >TIDY_ATTR_CELLPADDING</TD ></TR ><TR ><TD >TIDY_ATTR_CELLSPACING</TD ></TR ><TR ><TD >TIDY_ATTR_CHAR</TD ></TR ><TR ><TD >TIDY_ATTR_CHAROFF</TD ></TR ><TR ><TD >TIDY_ATTR_CHARSET</TD ></TR ><TR ><TD >TIDY_ATTR_CHECKED</TD ></TR ><TR ><TD >TIDY_ATTR_CITE</TD ></TR ><TR ><TD >TIDY_ATTR_CLASS</TD ></TR ><TR ><TD >TIDY_ATTR_CLASSID</TD ></TR ><TR ><TD >TIDY_ATTR_CLEAR</TD ></TR ><TR ><TD >TIDY_ATTR_CODE</TD ></TR ><TR ><TD >TIDY_ATTR_CODEBASE</TD ></TR ><TR ><TD >TIDY_ATTR_CODETYPE</TD ></TR ><TR ><TD >TIDY_ATTR_COLOR</TD ></TR ><TR ><TD >TIDY_ATTR_COLS</TD ></TR ><TR ><TD >TIDY_ATTR_COLSPAN</TD ></TR ><TR ><TD >TIDY_ATTR_COMPACT</TD ></TR ><TR ><TD >TIDY_ATTR_CONTENT</TD ></TR ><TR ><TD >TIDY_ATTR_COORDS</TD ></TR ><TR ><TD >TIDY_ATTR_DATA</TD ></TR ><TR ><TD >TIDY_ATTR_DATAFLD</TD ></TR ><TR ><TD >TIDY_ATTR_DATAPAGESIZE</TD ></TR ><TR ><TD >TIDY_ATTR_DATASRC</TD ></TR ><TR ><TD >TIDY_ATTR_DATETIME</TD ></TR ><TR ><TD >TIDY_ATTR_DECLARE</TD ></TR ><TR ><TD >TIDY_ATTR_DEFER</TD ></TR ><TR ><TD >TIDY_ATTR_DIR</TD ></TR ><TR ><TD >TIDY_ATTR_DISABLED</TD ></TR ><TR ><TD >TIDY_ATTR_ENCODING</TD ></TR ><TR ><TD >TIDY_ATTR_ENCTYPE</TD ></TR ><TR ><TD >TIDY_ATTR_FACE</TD ></TR ><TR ><TD >TIDY_ATTR_FOR</TD ></TR ><TR ><TD >TIDY_ATTR_FRAME</TD ></TR ><TR ><TD >TIDY_ATTR_FRAMEBORDER</TD ></TR ><TR ><TD >TIDY_ATTR_FRAMESPACING</TD ></TR ><TR ><TD >TIDY_ATTR_GRIDX</TD ></TR ><TR ><TD >TIDY_ATTR_GRIDY</TD ></TR ><TR ><TD >TIDY_ATTR_HEADERS</TD ></TR ><TR ><TD >TIDY_ATTR_HEIGHT</TD ></TR ><TR ><TD >TIDY_ATTR_HREF</TD ></TR ><TR ><TD >TIDY_ATTR_HREFLANG</TD ></TR ><TR ><TD >TIDY_ATTR_HSPACE</TD ></TR ><TR ><TD >TIDY_ATTR_HTTP_EQUIV</TD ></TR ><TR ><TD >TIDY_ATTR_ID</TD ></TR ><TR ><TD >TIDY_ATTR_ISMAP</TD ></TR ><TR ><TD >TIDY_ATTR_LABEL</TD ></TR ><TR ><TD >TIDY_ATTR_LANG</TD ></TR ><TR ><TD >TIDY_ATTR_LANGUAGE</TD ></TR ><TR ><TD >TIDY_ATTR_LAST_MODIFIED</TD ></TR ><TR ><TD >TIDY_ATTR_LAST_VISIT</TD ></TR ><TR ><TD >TIDY_ATTR_LEFTMARGIN</TD ></TR ><TR ><TD >TIDY_ATTR_LINK</TD ></TR ><TR ><TD >TIDY_ATTR_LONGDESC</TD ></TR ><TR ><TD >TIDY_ATTR_LOWSRC</TD ></TR ><TR ><TD >TIDY_ATTR_MARGINHEIGHT</TD ></TR ><TR ><TD >TIDY_ATTR_MARGINWIDTH</TD ></TR ><TR ><TD >TIDY_ATTR_MAXLENGTH</TD ></TR ><TR ><TD >TIDY_ATTR_MEDIA</TD ></TR ><TR ><TD >TIDY_ATTR_METHOD</TD ></TR ><TR ><TD >TIDY_ATTR_MULTIPLE</TD ></TR ><TR ><TD >TIDY_ATTR_NAME</TD ></TR ><TR ><TD >TIDY_ATTR_NOHREF</TD ></TR ><TR ><TD >TIDY_ATTR_NORESIZE</TD ></TR ><TR ><TD >TIDY_ATTR_NOSHADE</TD ></TR ><TR ><TD >TIDY_ATTR_NOWRAP</TD ></TR ><TR ><TD >TIDY_ATTR_OBJECT</TD ></TR ><TR ><TD >TIDY_ATTR_OnAFTERUPDATE</TD ></TR ><TR ><TD >TIDY_ATTR_OnBEFOREUNLOAD</TD ></TR ><TR ><TD >TIDY_ATTR_OnBEFOREUPDATE</TD ></TR ><TR ><TD >TIDY_ATTR_OnBLUR</TD ></TR ><TR ><TD >TIDY_ATTR_OnCHANGE</TD ></TR ><TR ><TD >TIDY_ATTR_OnCLICK</TD ></TR ><TR ><TD >TIDY_ATTR_OnDATAAVAILABLE</TD ></TR ><TR ><TD >TIDY_ATTR_OnDATASETCHANGED</TD ></TR ><TR ><TD >TIDY_ATTR_OnDATASETCOMPLETE</TD ></TR ><TR ><TD >TIDY_ATTR_OnDBLCLICK</TD ></TR ><TR ><TD >TIDY_ATTR_OnERRORUPDATE</TD ></TR ><TR ><TD >TIDY_ATTR_OnFOCUS</TD ></TR ><TR ><TD >TIDY_ATTR_OnKEYDOWN</TD ></TR ><TR ><TD >TIDY_ATTR_OnKEYPRESS</TD ></TR ><TR ><TD >TIDY_ATTR_OnKEYUP</TD ></TR ><TR ><TD >TIDY_ATTR_OnLOAD</TD ></TR ><TR ><TD >TIDY_ATTR_OnMOUSEDOWN</TD ></TR ><TR ><TD >TIDY_ATTR_OnMOUSEMOVE</TD ></TR ><TR ><TD >TIDY_ATTR_OnMOUSEOUT</TD ></TR ><TR ><TD >TIDY_ATTR_OnMOUSEOVER</TD ></TR ><TR ><TD >TIDY_ATTR_OnMOUSEUP</TD ></TR ><TR ><TD >TIDY_ATTR_OnRESET</TD ></TR ><TR ><TD >TIDY_ATTR_OnROWENTER</TD ></TR ><TR ><TD >TIDY_ATTR_OnROWEXIT</TD ></TR ><TR ><TD >TIDY_ATTR_OnSELECT</TD ></TR ><TR ><TD >TIDY_ATTR_OnSUBMIT</TD ></TR ><TR ><TD >TIDY_ATTR_OnUNLOAD</TD ></TR ><TR ><TD >TIDY_ATTR_PROFILE</TD ></TR ><TR ><TD >TIDY_ATTR_PROMPT</TD ></TR ><TR ><TD >TIDY_ATTR_RBSPAN</TD ></TR ><TR ><TD >TIDY_ATTR_READONLY</TD ></TR ><TR ><TD >TIDY_ATTR_REL</TD ></TR ><TR ><TD >TIDY_ATTR_REV</TD ></TR ><TR ><TD >TIDY_ATTR_RIGHTMARGIN</TD ></TR ><TR ><TD >TIDY_ATTR_ROWS</TD ></TR ><TR ><TD >TIDY_ATTR_ROWSPAN</TD ></TR ><TR ><TD >TIDY_ATTR_RULES</TD ></TR ><TR ><TD >TIDY_ATTR_SCHEME</TD ></TR ><TR ><TD >TIDY_ATTR_SCOPE</TD ></TR ><TR ><TD >TIDY_ATTR_SCROLLING</TD ></TR ><TR ><TD >TIDY_ATTR_SELECTED</TD ></TR ><TR ><TD >TIDY_ATTR_SHAPE</TD ></TR ><TR ><TD >TIDY_ATTR_SHOWGRID</TD ></TR ><TR ><TD >TIDY_ATTR_SHOWGRIDX</TD ></TR ><TR ><TD >TIDY_ATTR_SHOWGRIDY</TD ></TR ><TR ><TD >TIDY_ATTR_SIZE</TD ></TR ><TR ><TD >TIDY_ATTR_SPAN</TD ></TR ><TR ><TD >TIDY_ATTR_SRC</TD ></TR ><TR ><TD >TIDY_ATTR_STANDBY</TD ></TR ><TR ><TD >TIDY_ATTR_START</TD ></TR ><TR ><TD >TIDY_ATTR_STYLE</TD ></TR ><TR ><TD >TIDY_ATTR_SUMMARY</TD ></TR ><TR ><TD >TIDY_ATTR_TABINDEX</TD ></TR ><TR ><TD >TIDY_ATTR_TARGET</TD ></TR ><TR ><TD >TIDY_ATTR_TEXT</TD ></TR ><TR ><TD >TIDY_ATTR_TITLE</TD ></TR ><TR ><TD >TIDY_ATTR_TOPMARGIN</TD ></TR ><TR ><TD >TIDY_ATTR_TYPE</TD ></TR ><TR ><TD >TIDY_ATTR_USEMAP</TD ></TR ><TR ><TD >TIDY_ATTR_VALIGN</TD ></TR ><TR ><TD >TIDY_ATTR_VALUE</TD ></TR ><TR ><TD >TIDY_ATTR_VALUETYPE</TD ></TR ><TR ><TD >TIDY_ATTR_VERSION</TD ></TR ><TR ><TD >TIDY_ATTR_VLINK</TD ></TR ><TR ><TD >TIDY_ATTR_VSPACE</TD ></TR ><TR ><TD >TIDY_ATTR_WIDTH</TD ></TR ><TR ><TD >TIDY_ATTR_WRAP</TD ></TR ><TR ><TD >TIDY_ATTR_XML_LANG</TD ></TR ><TR ><TD >TIDY_ATTR_XML_SPACE</TD ></TR ><TR ><TD >TIDY_ATTR_XMLNS</TD ></TR ></TBODY ></TABLE ></DIV > </P ><P > <DIV CLASS="table" ><A NAME="AEN227432" ></A ><P ><B >Tabela 4. tidy nodetype constants</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><THEAD ><TR ><TH >constant</TH ><TH >description</TH ></TR ></THEAD ><TBODY ><TR ><TD >TIDY_NODETYPE_ROOT</TD ><TD >root node</TD ></TR ><TR ><TD >TIDY_NODETYPE_DOCTYPE</TD ><TD >doctype</TD ></TR ><TR ><TD >TIDY_NODETYPE_COMMENT</TD ><TD >HTML comment</TD ></TR ><TR ><TD >TIDY_NODETYPE_PROCINS</TD ><TD >Processing Instruction</TD ></TR ><TR ><TD >TIDY_NODETYPE_TEXT</TD ><TD >Text</TD ></TR ><TR ><TD >TIDY_NODETYPE_START</TD ><TD >start tag</TD ></TR ><TR ><TD >TIDY_NODETYPE_END</TD ><TD >end tag</TD ></TR ><TR ><TD >TIDY_NODETYPE_STARTEND</TD ><TD >empty tag</TD ></TR ><TR ><TD >TIDY_NODETYPE_CDATA</TD ><TD >CDATA</TD ></TR ><TR ><TD >TIDY_NODETYPE_SECTION</TD ><TD >XML section</TD ></TR ><TR ><TD >TIDY_NODETYPE_ASP</TD ><TD >ASP code</TD ></TR ><TR ><TD >TIDY_NODETYPE_JSTE</TD ><TD >JSTE code</TD ></TR ><TR ><TD >TIDY_NODETYPE_PHP</TD ><TD >PHP code</TD ></TR ><TR ><TD >TIDY_NODETYPE_XMLDECL</TD ><TD >XML declaration</TD ></TR ></TBODY ></TABLE ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="tidy.examples" >Exemplos</A ></H1 ><P > This simple example shows basic Tidy usage. <TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN227485" ></A ><P ><B >Exemplo 2. Basic Tidy usage</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br />ob_start</font><font color="#007700">();<br /></font><font color="#0000BB">?><br /></font><html>a html document</html><br /><font color="#0000BB"><?php<br />$html </font><font color="#007700">= </font><font color="#0000BB">ob_get_clean</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Specify configuration<br /></font><font color="#0000BB">$config </font><font color="#007700">= array(<br /> </font><font color="#DD0000">'indent' </font><font color="#007700">=> </font><font color="#0000BB">true</font><font color="#007700">,<br /> </font><font color="#DD0000">'output-xhtml' </font><font color="#007700">=> </font><font color="#0000BB">true</font><font color="#007700">,<br /> </font><font color="#DD0000">'wrap' </font><font color="#007700">=> </font><font color="#0000BB">200</font><font color="#007700">);<br /><br /></font><font color="#FF8000">// Tidy<br /></font><font color="#0000BB">$tidy </font><font color="#007700">= new </font><font color="#0000BB">tidy</font><font color="#007700">;<br /></font><font color="#0000BB">$tidy</font><font color="#007700">-></font><font color="#0000BB">parseString</font><font color="#007700">(</font><font color="#0000BB">$html</font><font color="#007700">, </font><font color="#0000BB">$config</font><font color="#007700">, </font><font color="#DD0000">'utf8'</font><font color="#007700">);<br /></font><font color="#0000BB">$tidy</font><font color="#007700">-></font><font color="#0000BB">cleanRepair</font><font color="#007700">();<br /><br /></font><font color="#FF8000">// Output<br /></font><font color="#007700">echo </font><font color="#0000BB">$tidy</font><font color="#007700">;<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE > </P ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Índice</B ></DT ><DT ><A HREF="function.ob-tidyhandler.html" >ob_tidyhandler</A > -- ob_start callback function to repair the buffer </DT ><DT ><A HREF="function.tidy-access-count.html" >tidy_access_count</A > -- Returns the Number of Tidy accessibility warnings encountered for specified document </DT ><DT ><A HREF="function.tidy-clean-repair.html" >tidy_clean_repair</A > -- Execute configured cleanup and repair operations on parsed markup </DT ><DT ><A HREF="function.tidy-config-count.html" >tidy_config_count</A > -- Returns the Number of Tidy configuration errors encountered for specified document </DT ><DT ><A HREF="function.tidy-construct.html" >tidy::__construct</A > -- Constructs a new tidy object </DT ><DT ><A HREF="function.tidy-diagnose.html" >tidy_diagnose</A > -- Run configured diagnostics on parsed and repaired markup </DT ><DT ><A HREF="function.tidy-error-count.html" >tidy_error_count</A > -- Returns the Number of Tidy errors encountered for specified document </DT ><DT ><A HREF="function.tidy-get-body.html" >tidy_get_body</A > -- Returns a tidyNode Object starting from the <body> tag of the tidy parse tree </DT ><DT ><A HREF="function.tidy-get-config.html" >tidy_get_config</A > -- Get current Tidy configuration </DT ><DT ><A HREF="function.tidy-get-error-buffer.html" >tidy_get_error_buffer</A > -- Return warnings and errors which occurred parsing the specified document </DT ><DT ><A HREF="function.tidy-get-head.html" >tidy_get_head</A > -- Returns a tidyNode Object starting from the <head> tag of the tidy parse tree </DT ><DT ><A HREF="function.tidy-get-html-ver.html" >tidy_get_html_ver</A > -- Get the Detected HTML version for the specified document </DT ><DT ><A HREF="function.tidy-get-html.html" >tidy_get_html</A > -- Returns a tidyNode Object starting from the <html> tag of the tidy parse tree </DT ><DT ><A HREF="function.tidy-get-opt-doc.html" >tidy_get_opt_doc</A > -- Returns the documentation for the given option name </DT ><DT ><A HREF="function.tidy-get-output.html" >tidy_get_output</A > -- Return a string representing the parsed tidy markup </DT ><DT ><A HREF="function.tidy-get-release.html" >tidy_get_release</A > -- Get release date (version) for Tidy library </DT ><DT ><A HREF="function.tidy-get-root.html" >tidy_get_root</A > -- Returns a tidyNode object representing the root of the tidy parse tree </DT ><DT ><A HREF="function.tidy-get-status.html" >tidy_get_status</A > -- Get status of specified document </DT ><DT ><A HREF="function.tidy-getopt.html" >tidy_getopt</A > -- Returns the value of the specified configuration option for the tidy document </DT ><DT ><A HREF="function.tidy-is-xhtml.html" >tidy_is_xhtml</A > -- Indicates if the document is a XHTML document </DT ><DT ><A HREF="function.tidy-is-xml.html" >tidy_is_xml</A > -- Indicates if the document is a generic (non HTML/XHTML) XML document </DT ><DT ><A HREF="function.tidy-load-config.html" >tidy_load_config</A > -- Load an ASCII Tidy configuration file with the specified encoding </DT ><DT ><A HREF="function.tidy-node-get-attr.html" >tidy_node->get_attr</A > -- Return the attribute with the provided attribute id </DT ><DT ><A HREF="function.tidy-node-get-nodes.html" >tidy_node->get_nodes</A > -- Return an array of nodes under this node with the specified id </DT ><DT ><A HREF="function.tidy-node-next.html" >tidy_node->next</A > -- Returns the next sibling to this node </DT ><DT ><A HREF="function.tidy-node-prev.html" >tidy_node->prev</A > -- Returns the previous sibling to this node </DT ><DT ><A HREF="function.tidy-parse-file.html" >tidy_parse_file</A > -- Parse markup in file or URI </DT ><DT ><A HREF="function.tidy-parse-string.html" >tidy_parse_string</A > -- Parse a document stored in a string </DT ><DT ><A HREF="function.tidy-repair-file.html" >tidy_repair_file</A > -- Repair a file and return it as a string </DT ><DT ><A HREF="function.tidy-repair-string.html" >tidy_repair_string</A > -- Repair a string using an optionally provided configuration file </DT ><DT ><A HREF="function.tidy-reset-config.html" >tidy_reset_config</A > -- Restore Tidy configuration to default values </DT ><DT ><A HREF="function.tidy-save-config.html" >tidy_save_config</A > -- Save current settings to named file </DT ><DT ><A HREF="function.tidy-set-encoding.html" >tidy_set_encoding</A > -- Set the input/output character encoding for parsing markup </DT ><DT ><A HREF="function.tidy-setopt.html" >tidy_setopt</A > -- Updates the configuration settings for the specified tidy document </DT ><DT ><A HREF="function.tidy-warning-count.html" >tidy_warning_count</A > -- Returns the Number of Tidy warnings encountered for specified document </DT ><DT ><A HREF="function.tidynode-haschildren.html" >tidyNode->hasChildren</A > -- Returns true if this node has children </DT ><DT ><A HREF="function.tidynode-hassiblings.html" >tidyNode->hasSiblings</A > -- Returns true if this node has siblings </DT ><DT ><A HREF="function.tidynode-isasp.html" >tidyNode->isAsp</A > -- Returns true if this node is ASP </DT ><DT ><A HREF="function.tidynode-iscomment.html" >tidyNode->isComment</A > -- Returns true if this node represents a comment </DT ><DT ><A HREF="function.tidynode-ishtml.html" >tidyNode->isHtml</A > -- Returns true if this node is part of a HTML document </DT ><DT ><A HREF="function.tidynode-isjste.html" >tidyNode->isJste</A > -- Returns true if this node is JSTE </DT ><DT ><A HREF="function.tidynode-isphp.html" >tidyNode->isPhp</A > -- Returns true if this node is PHP </DT ><DT ><A HREF="function.tidynode-istext.html" >tidyNode->isText</A > -- Returns true if this node represents text (no markup) </DT ><DT ><A HREF="function.tidynode-getparent.html" >tidyNode::getParent</A > -- returns the parent node of the current node</DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.tcpwrap-check.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="function.ob-tidyhandler.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >tcpwrap_check</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >ob_tidyhandler</TD ></TR ></TABLE ></DIV ></BODY ></HTML >