1--TEST-- 2Accessing root, body, html, and head nodes.. 3--SKIPIF-- 4<?php if (!extension_loaded("tidy")) print "skip"; ?> 5--FILE-- 6<?php 7$a = tidy_parse_string("<HTML><BODY BGCOLOR=#FFFFFF ALINK=#000000></BODY></HTML>", array('newline' => 'LF')); 8var_dump($a->root()); 9var_dump($a->body()); 10var_dump($a->html()); 11var_dump($a->head()); 12 13?> 14--EXPECT-- 15object(tidyNode)#2 (8) { 16 ["value"]=> 17 string(94) "<html> 18<head> 19<title></title> 20</head> 21<body bgcolor="#FFFFFF" alink="#000000"> 22</body> 23</html>" 24 ["name"]=> 25 string(0) "" 26 ["type"]=> 27 int(0) 28 ["line"]=> 29 int(1) 30 ["column"]=> 31 int(1) 32 ["proprietary"]=> 33 bool(false) 34 ["attribute"]=> 35 NULL 36 ["child"]=> 37 array(1) { 38 [0]=> 39 object(tidyNode)#3 (9) { 40 ["value"]=> 41 string(94) "<html> 42<head> 43<title></title> 44</head> 45<body bgcolor="#FFFFFF" alink="#000000"> 46</body> 47</html>" 48 ["name"]=> 49 string(4) "html" 50 ["type"]=> 51 int(5) 52 ["line"]=> 53 int(1) 54 ["column"]=> 55 int(1) 56 ["proprietary"]=> 57 bool(false) 58 ["id"]=> 59 int(48) 60 ["attribute"]=> 61 NULL 62 ["child"]=> 63 array(2) { 64 [0]=> 65 object(tidyNode)#4 (9) { 66 ["value"]=> 67 string(31) "<head> 68<title></title> 69</head> 70" 71 ["name"]=> 72 string(4) "head" 73 ["type"]=> 74 int(5) 75 ["line"]=> 76 int(1) 77 ["column"]=> 78 int(7) 79 ["proprietary"]=> 80 bool(false) 81 ["id"]=> 82 int(46) 83 ["attribute"]=> 84 NULL 85 ["child"]=> 86 array(1) { 87 [0]=> 88 object(tidyNode)#5 (9) { 89 ["value"]=> 90 string(16) "<title></title> 91" 92 ["name"]=> 93 string(5) "title" 94 ["type"]=> 95 int(5) 96 ["line"]=> 97 int(1) 98 ["column"]=> 99 int(57) 100 ["proprietary"]=> 101 bool(false) 102 ["id"]=> 103 int(111) 104 ["attribute"]=> 105 NULL 106 ["child"]=> 107 NULL 108 } 109 } 110 } 111 [1]=> 112 object(tidyNode)#6 (9) { 113 ["value"]=> 114 string(49) "<body bgcolor="#FFFFFF" alink="#000000"> 115</body> 116" 117 ["name"]=> 118 string(4) "body" 119 ["type"]=> 120 int(5) 121 ["line"]=> 122 int(1) 123 ["column"]=> 124 int(7) 125 ["proprietary"]=> 126 bool(false) 127 ["id"]=> 128 int(16) 129 ["attribute"]=> 130 array(2) { 131 ["bgcolor"]=> 132 string(7) "#FFFFFF" 133 ["alink"]=> 134 string(7) "#000000" 135 } 136 ["child"]=> 137 NULL 138 } 139 } 140 } 141 } 142} 143object(tidyNode)#2 (9) { 144 ["value"]=> 145 string(49) "<body bgcolor="#FFFFFF" alink="#000000"> 146</body> 147" 148 ["name"]=> 149 string(4) "body" 150 ["type"]=> 151 int(5) 152 ["line"]=> 153 int(1) 154 ["column"]=> 155 int(7) 156 ["proprietary"]=> 157 bool(false) 158 ["id"]=> 159 int(16) 160 ["attribute"]=> 161 array(2) { 162 ["bgcolor"]=> 163 string(7) "#FFFFFF" 164 ["alink"]=> 165 string(7) "#000000" 166 } 167 ["child"]=> 168 NULL 169} 170object(tidyNode)#2 (9) { 171 ["value"]=> 172 string(94) "<html> 173<head> 174<title></title> 175</head> 176<body bgcolor="#FFFFFF" alink="#000000"> 177</body> 178</html>" 179 ["name"]=> 180 string(4) "html" 181 ["type"]=> 182 int(5) 183 ["line"]=> 184 int(1) 185 ["column"]=> 186 int(1) 187 ["proprietary"]=> 188 bool(false) 189 ["id"]=> 190 int(48) 191 ["attribute"]=> 192 NULL 193 ["child"]=> 194 array(2) { 195 [0]=> 196 object(tidyNode)#3 (9) { 197 ["value"]=> 198 string(31) "<head> 199<title></title> 200</head> 201" 202 ["name"]=> 203 string(4) "head" 204 ["type"]=> 205 int(5) 206 ["line"]=> 207 int(1) 208 ["column"]=> 209 int(7) 210 ["proprietary"]=> 211 bool(false) 212 ["id"]=> 213 int(46) 214 ["attribute"]=> 215 NULL 216 ["child"]=> 217 array(1) { 218 [0]=> 219 object(tidyNode)#6 (9) { 220 ["value"]=> 221 string(16) "<title></title> 222" 223 ["name"]=> 224 string(5) "title" 225 ["type"]=> 226 int(5) 227 ["line"]=> 228 int(1) 229 ["column"]=> 230 int(57) 231 ["proprietary"]=> 232 bool(false) 233 ["id"]=> 234 int(111) 235 ["attribute"]=> 236 NULL 237 ["child"]=> 238 NULL 239 } 240 } 241 } 242 [1]=> 243 object(tidyNode)#4 (9) { 244 ["value"]=> 245 string(49) "<body bgcolor="#FFFFFF" alink="#000000"> 246</body> 247" 248 ["name"]=> 249 string(4) "body" 250 ["type"]=> 251 int(5) 252 ["line"]=> 253 int(1) 254 ["column"]=> 255 int(7) 256 ["proprietary"]=> 257 bool(false) 258 ["id"]=> 259 int(16) 260 ["attribute"]=> 261 array(2) { 262 ["bgcolor"]=> 263 string(7) "#FFFFFF" 264 ["alink"]=> 265 string(7) "#000000" 266 } 267 ["child"]=> 268 NULL 269 } 270 } 271} 272object(tidyNode)#2 (9) { 273 ["value"]=> 274 string(31) "<head> 275<title></title> 276</head> 277" 278 ["name"]=> 279 string(4) "head" 280 ["type"]=> 281 int(5) 282 ["line"]=> 283 int(1) 284 ["column"]=> 285 int(7) 286 ["proprietary"]=> 287 bool(false) 288 ["id"]=> 289 int(46) 290 ["attribute"]=> 291 NULL 292 ["child"]=> 293 array(1) { 294 [0]=> 295 object(tidyNode)#4 (9) { 296 ["value"]=> 297 string(16) "<title></title> 298" 299 ["name"]=> 300 string(5) "title" 301 ["type"]=> 302 int(5) 303 ["line"]=> 304 int(1) 305 ["column"]=> 306 int(57) 307 ["proprietary"]=> 308 bool(false) 309 ["id"]=> 310 int(111) 311 ["attribute"]=> 312 NULL 313 ["child"]=> 314 NULL 315 } 316 } 317} 318