includes/Parser.php
public function getRootMF(DOMElement $context = null) {
		// start with mf2 root class name xpath
		$xpaths = array(
			'contains(concat(" ",normalize-space(@class)), " h-")'
		);

		// add mf1 root class names
		foreach ( $this->classicRootMap as $old => $new ) {
			$xpaths[] = '( contains(concat(" ",normalize-space(@class), " "), " ' . $old . ' ") )';
		}

		// final xpath with OR
		$xpath = '//*[' . implode(' or ', $xpaths) . ']';

		$mfElements = (null === $context)
			? $this->xpath->query($xpath)
			: $this->xpath->query('.' . $xpath, $context);

		return $mfElements;
	}
public function getRootMF(DOMElement $context = null) {
		// start with mf2 root class name xpath
		$xpaths = array(
			'contains(concat(" ",normalize-space(@class)), " h-")'
		);

		// add mf1 root class names
		foreach ( $this->classicRootMap as $old => $new ) {
			$xpaths[] = '( contains(concat(" ",normalize-space(@class), " "), " ' . $old . ' ") )';
		}

		// final xpath with OR
		$xpath = '//*[' . implode(' or ', $xpaths) . ']';

		$mfElements = (null === $context)
			? $this->xpath->query($xpath)
			: $this->xpath->query('.' . $xpath, $context);

		return $mfElements;
	}
public function getRootMF ( DOMElement $ context = null ) { // start with mf2 root class name xpath $ xpaths = array ( 'contains(concat(" ",normalize-space(@class)), " h-")' ) ; // add mf1 root class names foreach ( $ this -> classicRootMap as $ old => $ new ) { $ xpaths [ ] = '( contains(concat(" ",normalize-space(@class), " "), " ' . $ old . ' ") )' ; } // final xpath with OR $ xpath = '//*[' . implode ( ' or ' , $ xpaths ) . ']' ; $ mfElements = ( null === $ context ) ? $ this -> xpath -> query ( $ xpath ) : $ this -> xpath -> query ( '.' . $ xpath , $ context ) ; return $ mfElements ; }
Get the root microformat elements
@param DOMElement $context
@return DOMNodeList
Get the root microformat elements