protected function parseFragment($name) {
		$fileName = $this->loader->findFilename($name);
		$html5 = new HTML5();
		$dom = $html5->loadHTMLFragment(file_get_contents($fileName));

		if($html5->getErrors()) {
			$errors = "";
			foreach($html5->getErrors() as $error) {
				$errors .= "\n". $error;
			}
			throw new \Exception("Parsing error for template " . $name . " Errors: " . $errors);
		}

		return $dom;
	}