includes/Parser.php
public function convertLegacy() {
		$doc = $this->doc;
		$xp = new DOMXPath($doc);

		// replace all roots
		foreach ($this->classicRootMap as $old => $new) {
			foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $new . ' "))]') as $el) {
				$el->setAttribute('class', $el->getAttribute('class') . ' ' . $new);
			}
		}

		foreach ($this->classicPropertyMap as $oldRoot => $properties) {
			$newRoot = $this->classicRootMap[$oldRoot];
			foreach ($properties as $old => $data) {
				foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $data['replace'] . ' "))]') as $el) {
					$el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']);
				}
			}
		}

		return $this;
	}
public function convertLegacy() {
		$doc = $this->doc;
		$xp = new DOMXPath($doc);

		// replace all roots
		foreach ($this->classicRootMap as $old => $new) {
			foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $new . ' "))]') as $el) {
				$el->setAttribute('class', $el->getAttribute('class') . ' ' . $new);
			}
		}

		foreach ($this->classicPropertyMap as $oldRoot => $properties) {
			$newRoot = $this->classicRootMap[$oldRoot];
			foreach ($properties as $old => $data) {
				foreach ($xp->query('//*[contains(concat(" ", @class, " "), " ' . $oldRoot . ' ")]//*[contains(concat(" ", @class, " "), " ' . $old . ' ") and not(contains(concat(" ", @class, " "), " ' . $data['replace'] . ' "))]') as $el) {
					$el->setAttribute('class', $el->getAttribute('class') . ' ' . $data['replace']);
				}
			}
		}

		return $this;
	}
public function convertLegacy ( ) { $ doc = $ this -> doc ; $ xp = new DOMXPath ( $ doc ) ; // replace all roots foreach ( $ this -> classicRootMap as $ old => $ new ) { foreach ( $ xp -> query ( '//*[contains(concat(" ", @class, " "), " ' . $ old . ' ") and not(contains(concat(" ", @class, " "), " ' . $ new . ' "))]' ) as $ el ) { $ el -> setAttribute ( 'class' , $ el -> getAttribute ( 'class' ) . ' ' . $ new ) ; } } foreach ( $ this -> classicPropertyMap as $ oldRoot => $ properties ) { $ newRoot = $ this -> classicRootMap [ $ oldRoot ] ; foreach ( $ properties as $ old => $ data ) { foreach ( $ xp -> query ( '//*[contains(concat(" ", @class, " "), " ' . $ oldRoot . ' ")]//*[contains(concat(" ", @class, " "), " ' . $ old . ' ") and not(contains(concat(" ", @class, " "), " ' . $ data [ 'replace' ] . ' "))]' ) as $ el ) { $ el -> setAttribute ( 'class' , $ el -> getAttribute ( 'class' ) . ' ' . $ data [ 'replace' ] ) ; } } } return $ this ; }
Convert Legacy Classnames

Adds microformats2 classnames into a document containing only legacy
semantic classnames.

@return Parser $this
Convert Legacy Classnames