svn: /phpdoc/en/trunk/reference/tidy/tidynode/ isasp.xml iscomment.xml ishtml.xml isjste.xml isphp.xml istext.xml
| From: | Adam Harvey | Date: | Fri, 08 Oct 2010 03:42:25 +0000 |
| Subject: | svn: /phpdoc/en/trunk/reference/tidy/tidynode/ 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-7199@lists.php.net to get a copy of this message | ||
aharvey Fri, 08 Oct 2010 03:42:25 +0000
Revision: http://svn.php.net/viewvc?view=revision&revision=304197
Log:
Fix doc bug #53016 (same example for several methods but output is different)
by changing the tidyNode examples to use explicit method calls, rather than
constructing the method name at runtime -- it was a nice demonstration of the
$o->{$method}() syntax, but rather out of place in a set of examples meant to
show how to use the tidyNode class itself.
Bug: http://bugs.php.net/53016 (Assigned) same example for
several methods but output is different
Changed paths:
U phpdoc/en/trunk/reference/tidy/tidynode/isasp.xml
U phpdoc/en/trunk/reference/tidy/tidynode/iscomment.xml
U phpdoc/en/trunk/reference/tidy/tidynode/ishtml.xml
U phpdoc/en/trunk/reference/tidy/tidynode/isjste.xml
U phpdoc/en/trunk/reference/tidy/tidynode/isphp.xml
U phpdoc/en/trunk/reference/tidy/tidynode/istext.xml
Modified: phpdoc/en/trunk/reference/tidy/tidynode/isasp.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/isasp.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/isasp.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,20 +62,20 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'asp');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isAsp()) {
+ echo "\n\n# asp 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);
+ get_nodes($child);
}
}
}
Modified: phpdoc/en/trunk/reference/tidy/tidynode/iscomment.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/iscomment.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/iscomment.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,20 +62,20 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'comment');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isComment()) {
+ echo "\n\n# comment 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);
+ get_nodes($child);
}
}
}
@@ -91,11 +91,6 @@
/* JSTE code */
alert('Hello World');
#>
-
-/*
-var_dump($tidy->html()->child[0]->hasChildren());
-var_dump($tidy->html()->child[0]->child[0]->hasChildren());
-*/
]]>
</screen>
</example>
Modified: phpdoc/en/trunk/reference/tidy/tidynode/ishtml.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/ishtml.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/ishtml.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,19 +62,19 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'text');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isHtml()) {
+ echo "\n\n# html 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);
+ get_nodes($child);
}
}
}
Modified: phpdoc/en/trunk/reference/tidy/tidynode/isjste.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/isjste.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/isjste.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,20 +62,20 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'text');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isJste()) {
+ echo "\n\n# jste 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);
+ get_nodes($child);
}
}
}
@@ -91,11 +91,6 @@
/* JSTE code */
alert('Hello World');
#>
-
-/*
-var_dump($tidy->html()->child[0]->hasChildren());
-var_dump($tidy->html()->child[0]->child[0]->hasChildren());
-*/
]]>
</screen>
</example>
Modified: phpdoc/en/trunk/reference/tidy/tidynode/isphp.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/isphp.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/isphp.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,20 +62,20 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'php');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isPhp()) {
+ echo "\n\n# php 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);
+ get_nodes($child);
}
}
}
Modified: phpdoc/en/trunk/reference/tidy/tidynode/istext.xml
===================================================================
--- phpdoc/en/trunk/reference/tidy/tidynode/istext.xml 2010-10-08 02:39:31 UTC (rev 304196)
+++ phpdoc/en/trunk/reference/tidy/tidynode/istext.xml 2010-10-08 03:42:25 UTC (rev 304197)
@@ -62,20 +62,20 @@
$tidy = tidy_parse_string($html);
$num = 0;
-get_nodes($tidy->html(), 'text');
+get_nodes($tidy->html());
-function get_nodes($node, $node_type) {
+function get_nodes($node) {
// check if the current node is of requested type
- if($node->{"is$node_type"}()) {
- echo "\n\n# $node_type node #" . ++$GLOBALS['num'] . "\n";
+ if($node->isText()) {
+ echo "\n\n# text 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);
+ get_nodes($child);
}
}
}