diff --git a/ChangeLog b/ChangeLog
index d5aeb16c0ad12af23fdaefecf252cc1d14c6c86a..b45f769aac9b6f587b6a774a3ce3f028f9a670f1 100755
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2010-11-17  Jochen Rau <jochen.rau@typoplanet.de>
+
+	* Added feature #16395: Add basic support for RDFa in core (semantic web)
+
 2010-11-17  Steffen Gebert  <steffen@steffen-gebert.de>
 
 	* Fixed bug #14449: Deprecate usage of ImageMagick version 4 and 5
@@ -13904,4 +13908,4 @@ Charsets:
 
 --------------------
 
-SVN ID: $Id$
+SVN ID: $Id$
\ No newline at end of file
diff --git a/typo3/sysext/cms/tslib/class.tslib_pagegen.php b/typo3/sysext/cms/tslib/class.tslib_pagegen.php
index c69b6a3b05f8952f612d407e3ff0ab9bb8da258c..bc006518dc33bfa63115871c17ac8fa842cd9867 100644
--- a/typo3/sysext/cms/tslib/class.tslib_pagegen.php
+++ b/typo3/sysext/cms/tslib/class.tslib_pagegen.php
@@ -230,6 +230,7 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 					$GLOBALS['TSFE']->xhtmlVersion = 105;
 				break;
 				case 'xhtml_11':
+				case 'xhtml+rdfa_10':
 					$GLOBALS['TSFE']->xhtmlVersion = 110;
 				break;
 				case 'xhtml_2':
@@ -388,8 +389,9 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 				$docTypeParts[] = $GLOBALS['TSFE']->config['config']['xmlprologue'];
 		}
 		// Part 2: DTD
-		if ($GLOBALS['TSFE']->config['config']['doctype']) {
-			switch ((string) $GLOBALS['TSFE']->config['config']['doctype']) {
+		$doctype = $GLOBALS['TSFE']->config['config']['doctype'];
+		if ($doctype) {
+			switch ($doctype) {
 				case 'xhtml_trans' :
 					$docTypeParts[] = '<!DOCTYPE html
      PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
@@ -420,13 +422,18 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 	PUBLIC "-//W3C//DTD XHTML 2.0//EN"
 	"http://www.w3.org/TR/xhtml2/DTD/xhtml2.dtd">';
 					break;
+				case 'xhtml+rdfa_10' :
+					$docTypeParts[] = '<!DOCTYPE html
+	PUBLIC "-//W3C//DTD XHTML+RDFa 1.0//EN"
+	"http://www.w3.org/MarkUp/DTD/xhtml-rdfa-1.dtd">';
+					break;
 				case 'html_5' :
 					$docTypeParts[] = '<!DOCTYPE html>';
 					break;
 				case 'none' :
 					break;
 				default :
-					$docTypeParts[] = $GLOBALS['TSFE']->config['config']['doctype'];
+					$docTypeParts[] = $doctype;
 			}
 		} else {
 			$docTypeParts[] = '<!DOCTYPE html
@@ -434,12 +441,15 @@ See <a href="http://wiki.typo3.org/index.php/TYPO3_3.8.1" target="_blank">wiki.t
 		}
 
 		if ($GLOBALS['TSFE']->xhtmlVersion) {
-
-			// Setting <html> tag attributes:
-			$htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml';
 			$htmlTagAttributes['xml:lang'] = $htmlLang;
-			if ($GLOBALS['TSFE']->xhtmlVersion < 110) {
-				$htmlTagAttributes['lang'] = $htmlLang;
+		}
+		if ($GLOBALS['TSFE']->xhtmlVersion < 110 || $doctype === 'html_5') {
+			$htmlTagAttributes['lang'] = $htmlLang;
+		}
+		if ($GLOBALS['TSFE']->xhtmlVersion || $doctype === 'html_5') {
+			$htmlTagAttributes['xmlns'] = 'http://www.w3.org/1999/xhtml'; // We add this to HTML5 to achieve a slightly better backwards compatibility
+			foreach ($GLOBALS['TSFE']->config['config']['namespaces.'] as $prefix => $uri) {
+				$htmlTagAttributes['xmlns:' . htmlspecialchars($prefix)] = $uri; // $uri gets htmlspecialchared later
 			}
 		}
 
@@ -1187,4 +1197,4 @@ class FE_loadDBGroup extends t3lib_loadDBGroup {
 	var $fromTC = 0;	// Means that everything is returned instead of only uid and label-field
 }
 
-?>
+?>
\ No newline at end of file