FluentDOM
[ class tree: FluentDOM ] [ index: FluentDOM ] [ all elements ]

Usage Example: FluentDOM::not()

  1. <?php
  2. /**
  3. *
  4. @version $Id: not.php 322 2009-09-14 20:19:48Z subjective $
  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.  
  10. $xml = <<<XML
  11. <html>
  12. <head></head>
  13. <body>
  14.   <div></div>
  15.   <div id="blueone"></div>
  16.   <div></div>
  17.   <div class="green"></div>
  18.   <div class="green"></div>
  19.   <div class="gray"></div>
  20.   <div></div>
  21. </body>
  22. </html>
  23. XML;
  24.  
  25. require_once('../FluentDOM.php');
  26. echo FluentDOM($xml)
  27.   ->find('//div')
  28.   ->not('@class = "green" or @id = "blueone"')
  29.   ->addClass('blue');
  30. ?>

Documentation generated on Sun, 26 Sep 2010 01:00:50 +0200 by phpDocumentor 1.4.3