summaryrefslogtreecommitdiff
path: root/ext/tidy/examples/dumpit.php
diff options
context:
space:
mode:
Diffstat (limited to 'ext/tidy/examples/dumpit.php')
-rw-r--r--ext/tidy/examples/dumpit.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/ext/tidy/examples/dumpit.php b/ext/tidy/examples/dumpit.php
index 46d307d704..e0cda5e904 100644
--- a/ext/tidy/examples/dumpit.php
+++ b/ext/tidy/examples/dumpit.php
@@ -10,15 +10,13 @@
* Usage; php dumpit.php <filename>
*/
-
- $tidy = tidy_create();
- tidy_parse_file($tidy, $_SERVER['argv'][1]);
+ tidy_parse_file($_SERVER['argv'][1]);
/* Optionally you can do this here if you want to fix up the document */
- /* tidy_clean_repair($tidy); */
+ /* tidy_clean_repair(); */
- $tree = tidy_get_root($tidy);
+ $tree = tidy_get_root();
dump_tree($tree);
echo "\n";
@@ -70,12 +68,12 @@
}
/* Any attributes on this node? */
- if(count($node->attribs)) {
+ if(count($node->attributes())) {
do_leaf(" |\n", $indent);
do_leaf(" +---- Attributes\n", $indent);
/* Cycle through the attributes and display them and their values. */
- foreach($node->attribs as $attrib) {
+ foreach($node->attributes() as $attrib) {
do_leaf(" +--{$attrib->name}\n", $indent);
do_leaf(" | +-- Value: {$attrib->value}\n", $indent);
}
@@ -83,7 +81,7 @@
/* Recurse along the children to generate the remaining nodes */
if($node->has_children()) {
- foreach($node->children as $child) {
+ foreach($node->children() as $child) {
dump_tree($child, $indent + 3);
}
}