original_string: protected function buildNamespaceTree(\DOMDocument $dom)
      {
          $xpath = new \DOMXPath($dom);
          $namespaces = array();
          $qry = $xpath->query('//@namespace');
          for ($i = 0; $i < $qry->length; $i++) {
              if (isset($namespaces[$qry->item($i)->nodeValue])) {
                  continue;
              }
  
              $namespaces[$qry->item($i)->nodeValue] = true;
          }
  
          $namespaces = $this->generateNamespaceTree(array_keys($namespaces));
          $this->generateNamespaceElements($namespaces, $dom->documentElement);
      }
code: protected function buildNamespaceTree(\DOMDocument $dom)
      {
          $xpath = new \DOMXPath($dom);
          $namespaces = array();
          $qry = $xpath->query('//@namespace');
          for ($i = 0; $i < $qry->length; $i++) {
              if (isset($namespaces[$qry->item($i)->nodeValue])) {
                  continue;
              }
  
              $namespaces[$qry->item($i)->nodeValue] = true;
          }
  
          $namespaces = $this->generateNamespaceTree(array_keys($namespaces));
          $this->generateNamespaceElements($namespaces, $dom->documentElement);
      }
code_tokens: protected function buildNamespaceTree ( \ DOMDocument $ dom ) { $ xpath = new \ DOMXPath ( $ dom ) ; $ namespaces = array ( ) ; $ qry = $ xpath -> query ( '//@namespace' ) ; for ( $ i = 0 ; $ i < $ qry -> length ; $ i ++ ) { if ( isset ( $ namespaces [ $ qry -> item ( $ i ) -> nodeValue ] ) ) { continue ; } $ namespaces [ $ qry -> item ( $ i ) -> nodeValue ] = true ; } $ namespaces = $ this -> generateNamespaceTree ( array_keys ( $ namespaces ) ) ; $ this -> generateNamespaceElements ( $ namespaces , $ dom -> documentElement ) ; }
docstring: Collects all namespaces and sub-namespaces, and adds a new section in
  the DOM to provide an overview.
  
  @param \DOMDocument $dom Namespaces are extracted and a summary inserted
  in this object.
  
  @return void
docstring_tokens: Collects all namespaces and sub - namespaces and adds a new section in the DOM to provide an overview .