cvs: phpdoc /en/reference/tidy book.xml reference.xml tidynode.xml /en/reference/tidy/functions tidy-node-get-attr.xml tidy-node-get-nodes.xml
tidy-node-next.xml tidy-node-prev.xml tidyNode-hasChildren.xml tidyNode-hasSiblings.xml tidyNode-isAsp.xml tidyNode-isComment.xml tidyNode-isHtml.xml
tidyNode-isJste.xml tidyNode-isPhp.xml tidyNode-isText.xml tidynode-getparent.xml /en/reference/tidy/tidynode getparent.xml haschildren.xml
hassiblings.xml isasp.xml iscomment.xml ishtml.xml isjste.xml isphp.xml istext.xml

From: Date: Fri, 24 Apr 2009 13:20:06 +0000
Subject: cvs: phpdoc /en/reference/tidy book.xml reference.xml tidynode.xml /en/reference/tidy/functions tidy-node-get-attr.xml tidy-node-get-nodes.xml
tidy-node-next.xml tidy-node-prev.xml tidyNode-hasChildren.xml tidyNode-hasSiblings.xml tidyNode-isAsp.xml tidyNode-isComment.xml tidyNode-isHtml.xml
tidyNode-isJste.xml tidyNode-isPhp.xml tidyNode-isText.xml tidynode-getparent.xml /en/reference/tidy/tidynode getparent.xml haschildren.xml
hassiblings.xml isasp.xml iscomment.xml ishtml.xml isjste.xml isphp.xml istext.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-3862@lists.php.net to get a copy of this message
dams Fri Apr 24 13:20:06 2009 UTC Added files: /phpdoc/en/reference/tidy tidynode.xml /phpdoc/en/reference/tidy/tidynode getparent.xml haschildren.xml hassiblings.xml isasp.xml iscomment.xml ishtml.xml isjste.xml isphp.xml istext.xml Removed files: /phpdoc/en/reference/tidy/functions tidy-node-get-attr.xml tidy-node-get-nodes.xml tidy-node-next.xml tidy-node-prev.xml tidyNode-hasChildren.xml tidyNode-hasSiblings.xml tidyNode-isAsp.xml tidyNode-isComment.xml tidyNode-isHtml.xml tidyNode-isJste.xml tidyNode-isPhp.xml tidyNode-isText.xml tidynode-getparent.xml Modified files: /phpdoc/en/reference/tidy book.xml reference.xml Log: moving to tidyNode folder and function cleanup

http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/book.xml?r1=1.2&r2=1.3&diff_format=u Index: phpdoc/en/reference/tidy/book.xml diff -u phpdoc/en/reference/tidy/book.xml:1.2 phpdoc/en/reference/tidy/book.xml:1.3 --- phpdoc/en/reference/tidy/book.xml:1.2 Sun Dec 23 22:47:05 2007 +++ phpdoc/en/reference/tidy/book.xml Fri Apr 24 13:20:06 2009 @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.2 $ --> +<!-- $Revision: 1.3 $ --> <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.tidynode; &reference.tidy.reference; </book> http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/reference.xml?r1=1.17&r2=1.18&diff_format=u Index: phpdoc/en/reference/tidy/reference.xml diff -u phpdoc/en/reference/tidy/reference.xml:1.17 phpdoc/en/reference/tidy/reference.xml:1.18 --- phpdoc/en/reference/tidy/reference.xml:1.17 Thu Jun 5 05:03:04 2008 +++ phpdoc/en/reference/tidy/reference.xml Fri Apr 24 13:20:06 2009 @@ -1,92 +1,13 @@ <?xml version='1.0' encoding='iso-8859-1'?> -<!-- $Revision: 1.17 $ --> +<!-- $Revision: 1.18 $ --> <!-- Purpose: basic.other --> <!-- Membership: pecl, bundled, external --> <reference xml:id="ref.tidy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> <title>Tidy &Functions;</title> - <partintro> - <section xml:id='tidy.classes'> - &reftitle.classes; + &reference.tidy.entities.functions; - <section xml:id='tidy.class.tidynode'> - <title><classname>tidyNode</classname></title> - <section xml:id='tidy.class.tidynode.methods'> - &reftitle.methods; - <itemizedlist> - <listitem> - <para><xref linkend='function.tidynode-getparent' /> - Returns the parent of the current node</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-haschildren' /> - Returns &true; if the current node has children</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-hassiblings' /> - Returns &true; if the current node has siblings</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-isasp' /> - Returns &true; if the current node is ASP code</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-iscomment' /> - Returns &true; if the current node is a comment</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-ishtml' /> - Returns &true; if the current node is HTML</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-isjste' /> - Returns &true; if the current node is JSTE</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-isphp' /> - Returns &true; if the current node is PHP</para> - </listitem> - <listitem> - <para><xref linkend='function.tidynode-istext' /> - Returns &true; if the current node is Text (no markup)</para> - </listitem> - </itemizedlist> - </section> - - <section xml:id='tidy.class.tidynode.properties'> - &reftitle.properties; - <itemizedlist> - <listitem> - <para>value - the value of the node (e.g. the html text)</para> - </listitem> - <listitem> - <para>name - the name of the tag (e.g. html, a, etc..)</para> - </listitem> - <listitem> - <para>type - the type of the node (one of the constants above, e.g. <constant>TIDY_NODETYPE_PHP</constant>)</para> - </listitem> - <listitem> - <para>line* - the line where the node starts</para> - </listitem> - <listitem> - <para>column* - the column where the node starts</para> - </listitem> - <listitem> - <para>proprietary* - &true; if the node refers to a proprietary tag</para> - </listitem> - <listitem> - <para>id - the ID of the tag (one of the constants above, e.g. <constant>TIDY_TAG_FRAME</constant>)</para> - </listitem> - <listitem> - <para>attribute - an array with the attributes of the current node, or &null; if there aren't any</para> - </listitem> - <listitem> - <para>child - an array with the child <type>tidyNode</type>s, or &null; if there aren't any</para> - </listitem> - </itemizedlist> - <note> - <para> - The properties marked with * are just available since PHP 5.1.0. - </para> - </note> - </section> - </section> - </section> - </partintro> - - &reference.tidy.entities.functions; </reference> <!-- Keep this comment at the end of the file Local variables: http://cvs.php.net/viewvc.cgi/phpdoc/en/reference/tidy/tidynode.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode.xml +++ phpdoc/en/reference/tidy/tidynode.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <phpdoc:classref xmlns:phpdoc="http://php.net/ns/phpdoc" xml:id="class.tidynode" 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>TidyNode</classname> class</title> <titleabbrev>TidyNode</titleabbrev> <partintro> <!-- {{{ TidyNode intro --> <section xml:id="tidynode.intro"> &reftitle.intro; <para> An HTML node in an HTML file, as detected by tidy. </para> </section> <!-- }}} --> <section xml:id="tidynode.synopsis"> &reftitle.classsynopsis; <!-- {{{ Synopsis --> <classsynopsis> <ooclass><classname>TidyNode</classname></ooclass> <!-- {{{ Class synopsis --> <classsynopsisinfo> <ooclass> <classname>TidyNode</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.tidynode')/db:refentry/db:refsect1[@role='description']/descendant::db:methodsynopsis[1])" /> </classsynopsis> <!-- }}} --> </section> <!-- {{{ TidyNode properties --> <section xml:id="tidynode.props"> &reftitle.properties; <variablelist> <varlistentry xml:id="tidynode.props.value"> <term><varname>value</varname></term> <listitem> <para>The HTML representation of the node, including the surrounding tags.</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.name"> <term><varname>name</varname></term> <listitem> <para>The name of the HTML node</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.type"> <term><varname>type</varname></term> <listitem> <para>The type of the tag (one of the constants above, e.g. <constant>TIDY_NODETYPE_PHP</constant>)</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.line"> <term><varname>line</varname></term> <listitem> <para>The line number at which the tags is located in the file</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.column"> <term><varname>column</varname></term> <listitem> <para>The column number at which the tags is located in the file</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.proprietary"> <term><varname>proprietary</varname></term> <listitem> <para>Indicates if the node is a proprietary tag</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.id"> <term><varname>id</varname></term> <listitem> <para>The ID of the tag (one of the constants above, e.g. <constant>TIDY_TAG_FRAME</constant>)</para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.attribute"> <term><varname>attribute</varname></term> <listitem> <para> An array of string, representing the attributes names (as keys) of the current node. </para> </listitem> </varlistentry> <varlistentry xml:id="tidynode.props.child"> <term><varname>child</varname></term> <listitem> <para> An array of <classname>TidyNode</classname>, representing the children of the current node. </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.tidynode; </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/tidynode/getparent.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/getparent.xml +++ phpdoc/en/reference/tidy/tidynode/getparent.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-getparent" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::getParent</refname> <refpurpose>Returns the parent node of the current node</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>tidyNode</type><methodname>tidyNode::getParent</methodname> <void/> </methodsynopsis> <para> Returns the parent node of the current node. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Example with <function>tidyNode::hasChildren</function></title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> Hello World </body> </html> HTML; $tidy = tidy_parse_string($html); $num = 0; $node = $tidy->html()->child[0]->child[0]; var_dump($node->getparent()->name); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ string(4) "head" ]]> </screen> </example> </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns a <type>tidyNode</type> if the node has a parent, or &null; otherwise. </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/tidynode/haschildren.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/haschildren.xml +++ phpdoc/en/reference/tidy/tidynode/haschildren.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-haschildren" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::hasChildren</refname> <refpurpose>Checks if a node has children</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::hasChildren</methodname> <void/> </methodsynopsis> <para> Tells if the node has children. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node has children, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Example with <function>tidyNode::hasChildren</function></title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; // the head tag var_dump($tidy->html()->child[0]->hasChildren()); // the php inside the head tag var_dump($tidy->html()->child[0]->child[0]->hasChildren()); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ bool(true) bool(false) ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::has_children</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/hassiblings.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/hassiblings.xml +++ phpdoc/en/reference/tidy/tidynode/hassiblings.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-hassiblings" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::hasSiblings</refname> <refpurpose>Checks if a node has siblings</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::hasSiblings</methodname> <void/> </methodsynopsis> <para> Tells if the node has siblings. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node has siblings, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Example with <function>tidyNode::hasSiblings</function></title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; // the html tag var_dump($tidy->html()->hasSiblings()); // the head tag var_dump($tidy->html()->child[0]->hasSiblings()); ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ bool(false) bool(true) ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::has_siblings</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/isasp.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/isasp.xml +++ phpdoc/en/reference/tidy/tidynode/isasp.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-isasp" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::isAsp</refname> <refpurpose>Checks if this node is ASP</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode->isAsp</methodname> <void/> </methodsynopsis> <para> Tells whether the current node is ASP. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node is ASP, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract ASP code from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'asp'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # asp node #1 <% /* ASP code */ response.write("Hello World!") %> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::is_asp</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/iscomment.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/iscomment.xml +++ phpdoc/en/reference/tidy/tidynode/iscomment.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-iscomment" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::isComment</refname> <refpurpose>Checks if a node represents a comment</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::isComment</methodname> <void/> </methodsynopsis> <para> Tells if the node is a comment. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node is a comment, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract comments from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'comment'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # jste node #1 <# /* JSTE code */ alert('Hello World'); #> /* var_dump($tidy->html()->child[0]->hasChildren()); var_dump($tidy->html()->child[0]->child[0]->hasChildren()); */ ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::is_comment</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/ishtml.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/ishtml.xml +++ phpdoc/en/reference/tidy/tidynode/ishtml.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-ishtml" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode->isHtml</refname> <refpurpose>Checks if a node is part of a HTML document</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::isHtml</methodname> <void/> </methodsynopsis> <para> Tells if the node is part of HTML document. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node is part of a HTML document, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract HTML code from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'text'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # html node #1 <html> <head> <?php echo '<title>title</title>'; ?><# /* JSTE code */ alert('Hello World'); #> <title></title> </head> <body> <?php // PHP code echo 'hello world!'; ?><% /* ASP code */ response.write("Hello World!") %><!-- Comments --> Hello WorldOutside HTML </body> </html> # html node #2 <head> <?php echo '<title>title</title>'; ?><# /* JSTE code */ alert('Hello World'); #> <title></title> </head> # html node #3 <?php echo '<title>title</title>'; ?> # html node #4 <# /* JSTE code */ alert('Hello World'); #> # html node #5 <title></title> # html node #6 <body> <?php // PHP code echo 'hello world!'; ?><% /* ASP code */ response.write("Hello World!") %><!-- Comments --> Hello WorldOutside HTML </body> # html node #7 <?php // PHP code echo 'hello world!'; ?> # html node #8 <% /* ASP code */ response.write("Hello World!") %> # html node #9 <!-- Comments --> # html node #10 Hello World # html node #11 Outside HTML ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::is_html</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/isjste.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/isjste.xml +++ phpdoc/en/reference/tidy/tidynode/isjste.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-isjste" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode->isJste</refname> <refpurpose>Checks if this node is JSTE</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::isJste</methodname> <void/> </methodsynopsis> <para> Tells if the node is JSTE. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node is JSTE, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract JSTE code from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'text'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # jste node #1 <# /* JSTE code */ alert('Hello World'); #> /* var_dump($tidy->html()->child[0]->hasChildren()); var_dump($tidy->html()->child[0]->child[0]->hasChildren()); */ ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node->is_jste</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/isphp.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/isphp.xml +++ phpdoc/en/reference/tidy/tidynode/isphp.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-isphp" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::isPhp</refname> <refpurpose>Checks if a node is PHP</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::isPhp</methodname> <void/> </methodsynopsis> <para> Tells if the node is PHP. </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the current node is PHP code, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract PHP code from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'php'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # php node #1 <?php echo '<title>title</title>'; ?> # php node #2 <?php // PHP code echo 'hello world!'; ?> ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::is_php</function> in PHP 4/Tidy 1. </para> </note> </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/tidynode/istext.xml?view=markup&rev=1.1 Index: phpdoc/en/reference/tidy/tidynode/istext.xml +++ phpdoc/en/reference/tidy/tidynode/istext.xml <?xml version='1.0' encoding='utf-8'?> <!-- $Revision: 1.1 $ --> <refentry xml:id="function.tidynode-istext" xmlns="http://docbook.org/ns/docbook"> <refnamediv> <refname>tidyNode::isText</refname> <refpurpose>Checks if a node represents text (no markup)</refpurpose> </refnamediv> <refsect1 role="description"> &reftitle.description; <methodsynopsis> <type>bool</type><methodname>tidyNode::isText</methodname> <void/> </methodsynopsis> <para> Tells if the node represents a text (without any markup). </para> </refsect1> <refsect1 role="returnvalues"> &reftitle.returnvalues; <para> Returns &true; if the node represent a text, &false; otherwise. </para> </refsect1> <refsect1 role="examples"> &reftitle.examples; <para> <example> <title>Extract text from a mixed HTML document</title> <programlisting role="php"> <![CDATA[ <?php $html = <<< HTML <html><head> <?php echo '<title>title</title>'; ?> <# /* JSTE code */ alert('Hello World'); #> </head> <body> <?php // PHP code echo 'hello world!'; ?> <% /* ASP code */ response.write("Hello World!") %> <!-- Comments --> Hello World </body></html> Outside HTML HTML; $tidy = tidy_parse_string($html); $num = 0; get_nodes($tidy->html(), 'text'); function get_nodes($node, $node_type) { // check if the current node is of requested type if($node->{"is$node_type"}()) { echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n"; echo $node->value; } // check if the current node has childrens if($node->hasChildren()) { foreach($node->child as $child) { get_nodes($child, $node_type); } } } ?> ]]> </programlisting> &example.outputs; <screen> <![CDATA[ # text node #1 Hello World # text node #2 Outside HTML ]]> </screen> </example> </para> </refsect1> <refsect1 role="notes"> &reftitle.notes; <note> <para> This function was named <function>tidy_node::is_text</function> in PHP 4/Tidy 1. </para> </note> </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 -->
« previous php.doc.cvs (#3862) next »