PageRenderTime 49ms CodeModel.GetById 28ms RepoModel.GetById 0ms app.codeStats 0ms

/examples/next.php

http://github.com/ThomasWeinert/FluentDOM
PHP | 27 lines | 19 code | 2 blank | 6 comment | 0 complexity | 872526236e5fa98aa89e648799cff859 MD5 | raw file
  1. <?php
  2. /**
  3. *
  4. * @version $Id$
  5. * @license http://www.opensource.org/licenses/mit-license.php The MIT License
  6. * @copyright Copyright (c) 2009 Bastian Feder, Thomas Weinert
  7. */
  8. header('Content-type: text/plain');
  9. $xml = <<<XML
  10. <html>
  11. <head></head>
  12. <body>
  13. <div>
  14. <button disabled="disabled">First</button> <b>-</b> <span></span></div>
  15. <div><button>Second</button> - <span></span></div>
  16. <div><button disabled="disabled">Third</button> - <span></span></div>
  17. </body>
  18. </html>
  19. XML;
  20. require_once('../src/FluentDOM.php');
  21. echo FluentDOM($xml)
  22. ->find('//button[@disabled]')
  23. ->next()
  24. ->text('This button is disabled.');
  25. ?>