Changeset 254
- Timestamp:
- 04/24/07 16:22:18 (2 years ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
honeyclient/branches/exp/kindlund-multi_config/lib/HoneyClient/Util/Config.pm
r253 r254 328 328 a value like the following, within the global configuration file: 329 329 330 <HoneyClient>331 <Agent>332 <Driver>333 <address>localhost</address>334 </Driver>335 </Agent>336 </HoneyClient>330 <HoneyClient> 331 <Agent> 332 <Driver> 333 <address>localhost</address> 334 </Driver> 335 </Agent> 336 </HoneyClient> 337 337 338 338 If the "address" value is not found at this level within the XML tree, … … 341 341 # First try: 342 342 343 <HoneyClient>344 <Agent>345 <address>localhost</address>346 </Agent>347 </HoneyClient>343 <HoneyClient> 344 <Agent> 345 <address>localhost</address> 346 </Agent> 347 </HoneyClient> 348 348 349 349 # Last try: 350 350 351 <HoneyClient>352 <address>localhost</address>353 </HoneyClient>351 <HoneyClient> 352 <address>localhost</address> 353 </HoneyClient> 354 354 355 355 This function will stop its recursive search at the first value found, … … 363 363 a getVar(name => "foo") on the following XML: 364 364 365 <HoneyClient>366 <foo>367 <bar>123</bar>368 <bar>456</bar>369 <yok>789</yok>370 <yok>xxx</yok>371 </foo>372 </HoneyClient>365 <HoneyClient> 366 <foo> 367 <bar>123</bar> 368 <bar>456</bar> 369 <yok>789</yok> 370 <yok>xxx</yok> 371 </foo> 372 </HoneyClient> 373 373 374 374 Then the following $hashref will be returned: 375 375 376 $hashref = {377 'bar' => [ '123', '456' ],378 'yok' => [ '789', 'xxx' ],379 }376 $hashref = { 377 'bar' => [ '123', '456' ], 378 'yok' => [ '789', 'xxx' ], 379 } 380 380 381 381 I<Inputs>: … … 397 397 For example, if we perform a getVar(name => "foo") on the following XML: 398 398 399 <HoneyClient>400 <foo>401 THIS_TEXT_WILL_BE_LOST402 <bar>123</bar>403 <bar>456</bar>404 <yok>789</yok>405 <yok>xxx</yok>406 <yok><CHILD>zzz</CHILD></yok>407 </foo>408 </HoneyClient>399 <HoneyClient> 400 <foo> 401 THIS_TEXT_WILL_BE_LOST 402 <bar>123</bar> 403 <bar>456</bar> 404 <yok>789</yok> 405 <yok>xxx</yok> 406 <yok><CHILD>zzz</CHILD></yok> 407 </foo> 408 </HoneyClient> 409 409 410 410 Then the following $hashref will be returned: 411 411 412 $hashref = {413 'bar' => [ '123', '456' ],414 'yok' => [ '789', 'xxx', 'zzz' ],415 }412 $hashref = { 413 'bar' => [ '123', '456' ], 414 'yok' => [ '789', 'xxx', 'zzz' ], 415 } 416 416 417 417 Notice how the B<THIS_TEXT_WILL_BE_LOST> string got dropped and that
