[Mapbender-commits] r9825 - in trunk/mapbender: conf http/classes http/geoportal/xslt http/php

svn_mapbender at osgeo.org svn_mapbender at osgeo.org
Wed Dec 6 08:19:28 PST 2017


Author: armin11
Date: 2017-12-06 08:19:28 -0800 (Wed, 06 Dec 2017)
New Revision: 9825

Added:
   trunk/mapbender/http/geoportal/xslt/dcat-ap-rdf2rdfa.xsl
Modified:
   trunk/mapbender/conf/isoMetadata.conf
   trunk/mapbender/http/classes/class_iso19139.php
   trunk/mapbender/http/php/mod_layerISOMetadata.php
Log:
New option to export html+rdf-a - some further configuration needed

Modified: trunk/mapbender/conf/isoMetadata.conf
===================================================================
--- trunk/mapbender/conf/isoMetadata.conf	2017-12-01 11:46:27 UTC (rev 9824)
+++ trunk/mapbender/conf/isoMetadata.conf	2017-12-06 16:19:28 UTC (rev 9825)
@@ -11,7 +11,11 @@
 	html => _mb("Metadata identifier"),
 	value => "",
 	category => "identification",
-	description => _mb("A value uniquely identifying the resource. The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner).")
+	description => _mb("A value uniquely identifying the resource. The value domain of this metadata element is a mandatory character string code, generally assigned by the data owner, and a character string namespace uniquely identifying the context of the identifier code (for example, the data owner)."),
+	#rdf-a
+	property => null,
+	#content => null,
+	datatype => null
 ),
 //B 1.1 (1)
 array(	ibus => "rtitle",
@@ -23,7 +27,9 @@
 	html => _mb("Resource title"),
 	value => "",
 	category => "identification",
-	description => _mb("This a characteristic, and often unique, name by which the resource is known. The value domain of this metadata element is free text.")
+	description => _mb("This a characteristic, and often unique, name by which the resource is known. The value domain of this metadata element is free text."),
+	#rdf-a
+	property => 'http://purl.org/dc/terms/title',
 ),
 //B 1.2 (2)
 array(	ibus => "abstract",
@@ -35,7 +41,9 @@
 	html => _mb("Resource abstract"),
 	value => "",
 	category => "identification",
-	description => _mb("This is a brief narrative summary of the content of the resource.")
+	description => _mb("This is a brief narrative summary of the content of the resource."),
+	#rdf-a
+	property => 'http://purl.org/dc/terms/description'
 ),
 //B 1.3 (3)
 array(	ibus => "rtype",
@@ -404,7 +412,10 @@
 	html => _mb("Metadata date"),
 	value => "",
 	category => "metadata",
-	description => _mb("The date which specifies when the metadata record was created or updated. This date shall be expressed in conformity with ISO 8601.")
+	description => _mb("The date which specifies when the metadata record was created or updated. This date shall be expressed in conformity with ISO 8601."),
+	#rdf-a
+	property => 'http://purl.org/dc/terms/modified',
+	datatype => 'http://www.w3.org/2001/XMLSchema#date'
 ),
 //B 10.3. Metadata language (32)
 array(	ibus => "t01_object.obj_id",
@@ -510,7 +521,11 @@
 	html => _mb("Encoding"),
 	value => "",
 	category => "dataspec",
-	description => _mb("Description of the computer language construct(s) specifying the representation of data objects in a record, file, message, storage device or transmission channel.")
+	description => _mb("Description of the computer language construct(s) specifying the representation of data objects in a record, file, message, storage device or transmission channel."),
+	//rdf-a
+	//property => "http://www.w3.org/2011/content#characterEncoding",
+	//content => null,
+	//datatype => "http://www.w3.org/2001/XMLSchema#string"
 ),
 /*
 //4. Topological Consistency ()
@@ -542,7 +557,11 @@
 	html => _mb("Character encoding"),
 	value => "",
 	category => "dataspec",
-	description => _mb("The character encoding used in the data set. This element is mandatory only if an encoding is used that is not based on UTF-8.")
+	description => _mb("The character encoding used in the data set. This element is mandatory only if an encoding is used that is not based on UTF-8."),	
+	//rdf-a
+	property => "http://www.w3.org/2011/content#characterEncoding",
+	content => null,
+	datatype => "http://www.w3.org/2001/XMLSchema#string"
 ),
 
 //Preview (36)

Modified: trunk/mapbender/http/classes/class_iso19139.php
===================================================================
--- trunk/mapbender/http/classes/class_iso19139.php	2017-12-01 11:46:27 UTC (rev 9824)
+++ trunk/mapbender/http/classes/class_iso19139.php	2017-12-06 16:19:28 UTC (rev 9825)
@@ -313,7 +313,7 @@
 					$this->datasetIdCodeSpace = rtrim($code[0], $this->datasetId);	
 				} else {
 					if (($parsedUrl['scheme'] == 'http' || $parsedUrl['scheme'] == 'https') && strpos($code[0],'#') !== false) {
-						//$e = new mb_exception($code[0]);
+						$e = new mb_exception($code[0]);
 						$explodedUrl = explode('#', $code[0]);
 						$this->datasetId = $explodedUrl[1];
 						$this->datasetIdCodeSpace = $explodedUrl[0];
@@ -696,6 +696,23 @@
    		return $proc->transformToXML($xmlDoc);	
 	}
 
+	public function transformToHtml2() {
+		$dcat = $this->transformToRdf();
+		$xslDoc = new DOMDocument();
+   		$xslDoc->load(dirname(__FILE__) . "/../geoportal/xslt/dcat-ap-rdf2rdfa.xsl");
+   		$xmlDoc = new DOMDocument();
+   		$xmlDoc->loadXML($dcat);
+   		$proc = new XSLTProcessor();
+		libxml_use_internal_errors(true);
+   		$result = $proc->importStylesheet($xslDoc);
+		if (!$result) {
+    			foreach (libxml_get_errors() as $error) {
+        			$e = new mb_exception("Libxml error: {$error->message}\n");
+    			}
+		}
+   		return $proc->transformToXML($xmlDoc);	
+	}
+
 	public function transformToHtml($layout,$languageCode){
 		libxml_use_internal_errors(true);
 		//TODO don't parse it again, but change the internal parser function!
@@ -734,7 +751,7 @@
 				$iso19139Hash[$a]['value'] = ltrim($iso19139Hash[$a]['value'],',');
 			}
 			//generate html
-			$html = '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$languageCode.'">';
+			$html = '<!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml" xmlns:dcat="http://www.w3.org/ns/dcat#" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dctype="http://purl.org/dc/dcmitype/" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#" xmlns:vcard="http://www.w3.org/2006/vcard/ns#" xml:lang="'.$languageCode.'">';
 
 			$metadataStr .= '<head>' . 
 				'<title>'._mb("Metadata").'</title>' . 
@@ -808,44 +825,56 @@
 			$tableEnd = "</table>\n";
 			//**************************overview part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Overview").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Overview").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-1">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Overview").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-1">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("overview").'</h3>';
-				$html .= '<div>';
-			}
-			$html .= '<p>';
+			//$html .= '<p>';
 			$html .= '<fieldset><legend>'._mb("Metadata").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[0]['html']."</b>: ".$t_b.$iso19139Hash[0]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[31]['html']."</b>: ".$t_b.$iso19139Hash[31]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[32]['html']."</b>: ".$t_b.$iso19139Hash[32]['value'].$t_c;
+			#$html .= $t_a."<b>".$iso19139Hash[0]['html']."</b>: ".$t_b.'<p property="'.$iso19139Hash[0]['property'].'" datatype="'.$iso19139Hash[0]['datatype'].'" content="'.$iso19139Hash[0]['value'].'">'.$iso19139Hash[0]['value']."</p>".$t_c;
+			$hashIndices = array(0, 31 ,32);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			$html .= '<fieldset><legend>'._mb("Identification").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[1]['html']."</b>: ".$t_b.$iso19139Hash[1]['value'].$t_c;//title
-			$html .= $t_a."<b>".$iso19139Hash[2]['html']."</b>: ".$t_b.$iso19139Hash[2]['value'].$t_c;//abstract
-			$html .= $t_a."<b>".$iso19139Hash[3]['html']."</b>: ".$t_b.$iso19139Hash[3]['value'].$t_c;//type
+			$hashIndices = array(1, 2, 3); //title, abstract, type
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			if ($iso19139Hash[36]['value'] != "") {
 				$html .= $t_a."<b>".$iso19139Hash[36]['html']."</b>: ".$t_b."<img width=120 height=120 src = '".$iso19139Hash[36]['value']."'>".$t_c;//preview
 			}
 			//resource identifier
 			if ($iso19139Hash[37]['value'] != "") {
-				//split with #
+				//split with # - TODO alter this!
 				$mdIdentifier = explode('#',$iso19139Hash[37]['value']);
-				$html .= $t_a."<b>".$iso19139Hash[37]['html']."</b>: ".$t_b.$iso19139Hash[37]['value'].$t_c;//MD Identifier
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, 37); //MD Identifier
 			} else {
-				$html .= $t_a."<b>".$iso19139Hash[5]['html']."</b>: ".$t_b.$iso19139Hash[5]['value'].$t_c;//namespace
-				$html .= $t_a."<b>".$iso19139Hash[6]['html']."</b>: ".$t_b.$iso19139Hash[6]['value'].$t_c;//id
+				$hashIndices = array(5, 6); //namespace, id
+				foreach ($hashIndices as $index) {
+					$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+				}
 			}
-			$html .= $t_a."<b>".$iso19139Hash[26]['html']."</b>: ".$t_b.$iso19139Hash[26]['value'].$t_c;//orga name
-			$html .= $t_a."<b>".$iso19139Hash[27]['html']."</b>: ".$t_b.$iso19139Hash[27]['value'].$t_c;//email
+			$hashIndices = array(26, 27); //orga name, email
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 		
@@ -864,176 +893,218 @@
 			}
 			$html .= '<fieldset><legend>'._mb("Contact").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[26]['html']."</b>: ".$t_b.$iso19139Hash[26]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[27]['html']."</b>: ".$t_b.$iso19139Hash[27]['value'].$t_c;
+			$hashIndices = array(26, 27); //orga name, email
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			//**************************properties part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Properties").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Properties").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-2">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Properties").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-2">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("Properties").'</h3>';
-				$html .= '<div>';
-			}
-			$html .= '<p>';
+			//$html .= '<p>';
 			$html .= '<fieldset><legend>'._mb("Common").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[8]['html']."</b>: ".$t_b.$iso19139Hash[8]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[9]['html']."</b>: ".$t_b.$iso19139Hash[9]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[11]['html']."</b>: ".$t_b.$iso19139Hash[11]['value'].$t_c;
+			$hashIndices = array(8, 9, 11);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			$html .= '<fieldset><legend>'._mb("Geographic extent").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[33]['html']."</b>: ".$t_b.$iso19139Hash[33]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[12]['html']."</b>: ".$t_b.$iso19139Hash[12]['value'].$t_c;
+			$hashIndices = array(33, 12);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			$html .= '<fieldset><legend>'._mb("Temporal extent").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[38]['html']."</b>: ".$t_b.$iso19139Hash[38]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[39]['html']."</b>: ".$t_b.$iso19139Hash[39]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[14]['html']."</b>: ".$t_b.$iso19139Hash[14]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[15]['html']."</b>: ".$t_b.$iso19139Hash[15]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[16]['html']."</b>: ".$t_b.$iso19139Hash[16]['value'].$t_c;
+			$hashIndices = array(38, 39, 14, 15, 16);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			if ($iso19139Hash[3]['value'] == 'dataset' || $iso19139Hash[3]['value'] == 'series') {
 				$html .= '<fieldset><legend>'._mb("Format").'</legend>';
 				$html .= $tableBegin;
-				$html .= $t_a."<b>".$iso19139Hash[34]['html']."</b>: ".$t_b.$iso19139Hash[34]['value'].$t_c;
-				$html .= $t_a."<b>".$iso19139Hash[35]['html']."</b>: ".$t_b.$iso19139Hash[35]['value'].$t_c;
+				$hashIndices = array(34, 35);
+				foreach ($hashIndices as $index) {
+					$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+				}
 				$html .= $tableEnd;
 				$html .= '</fieldset>';
 			}
 			if ($iso19139Hash[3]['value'] == 'service') {
 				$html .= '<fieldset><legend>'._mb("Service information").'</legend>';
 				$html .= $tableBegin;
-				$html .= $t_a."<b>".$iso19139Hash[10]['html']."</b>: ".$t_b.$iso19139Hash[10]['value'].$t_c;
-				$html .= $t_a."<b>".$iso19139Hash[7]['html']."</b>: ".$t_b.$iso19139Hash[7]['value'].$t_c;
+				$hashIndices = array(10, 7);
+				foreach ($hashIndices as $index) {
+					$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+				}
 				$html .= $tableEnd;
 				$html .= '</fieldset>';
 			}
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			//**************************contact part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Properties").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Contact").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-3">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Contact").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-3">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("Properties").'</h3>';
-				$html .= '<div>';
-			}
-			$html .= '<p>';
+			//$html .= '<p>';
 			$html .= '<fieldset><legend>'._mb("Data/Service provider").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[26]['html']."</b>: ".$t_b.$iso19139Hash[26]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[28]['html']."</b>: ".$t_b.$iso19139Hash[28]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[27]['html']."</b>: ".$t_b.$iso19139Hash[27]['value'].$t_c;
+			$hashIndices = array(26, 28, 27);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			$html .= '<fieldset><legend>'._mb("Metadata provider").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[29]['html']."</b>: ".$t_b.$iso19139Hash[29]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[30]['html']."</b>: ".$t_b.$iso19139Hash[30]['value'].$t_c;
+			$hashIndices = array(29, 30);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			//**************************terms of use part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Terms of use").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Terms of use").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-4">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Terms of use").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-4">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("Terms of use").'</h3>';
-				$html .= '<div>';
-			}
-			$html .= '<p>';
+			//$html .= '<p>';
 			$html .= '<fieldset><legend>'._mb("Conditions").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[23]['html']."</b>: ".$t_b.$iso19139Hash[23]['value'].$t_c;
+			$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, 23);
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
 			$html .= '<fieldset><legend>'._mb("Access constraints").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[24]['html']."</b>: ".$t_b.$iso19139Hash[24]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[25]['html']."</b>: ".$t_b.$iso19139Hash[25]['value'].$t_c;
+			$hashIndices = array(24, 25);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			//**************************quality part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Quality").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Quality").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-5">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Quality").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-5">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("Quality").'</h3>';
-				$html .= '<div>';
-			}
-			$html .= '<p>';
+			//$html .= '<p>';
 			if ($iso19139Hash[3]['value'] == 'dataset' || $iso19139Hash[3]['value'] == 'series') {
 				$html .= '<fieldset><legend>'._mb("Lineage").'</legend>';
 				$html .= $tableBegin;
-				$html .= $t_a."<b>".$iso19139Hash[17]['html']."</b>: ".$t_b.$iso19139Hash[17]['value'].$t_c;
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, 17);
 				$html .= $tableEnd;
 				$html .= '</fieldset>';
 				$html .= '<fieldset><legend>'._mb("Resolution").'</legend>';
 				$html .= $tableBegin;
-				$html .= $t_a."<b>".$iso19139Hash[18]['html']."</b>: ".$t_b.$iso19139Hash[18]['value'].$t_c;
-				$html .= $t_a."<b>".$iso19139Hash[19]['html']."</b>: ".$t_b.$iso19139Hash[19]['value'].$t_c;
+				$hashIndices = array(18, 19);
+				foreach ($hashIndices as $index) {
+					$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+				}
 				$html .= $tableEnd;
 				$html .= '</fieldset>';
 			}
 			$html .= '<fieldset><legend>'._mb("Validity").'</legend>';
 			$html .= $tableBegin;
-			$html .= $t_a."<b>".$iso19139Hash[20]['html']."</b>: ".$t_b.$iso19139Hash[20]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[21]['html']."</b>: ".$t_b.$iso19139Hash[21]['value'].$t_c;
-			$html .= $t_a."<b>".$iso19139Hash[22]['html']."</b>: ".$t_b.$iso19139Hash[22]['value'].$t_c;
+			$hashIndices = array(20, 21, 22);
+			foreach ($hashIndices as $index) {
+				$html .= $this->getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $index);
+			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			//**************************Interfaces part begin******************************
 			//generate div tags for the content - the divs are defined in the array
-			if ($layout == 'accordion') {
-				$html .= '<h3><a href="#">'._mb("Interfaces").'</a></h3>';
-				$html .= '<div style="height:300px">';
+			switch ($layout) {
+				case "accordion":
+					$html .= '<h3><a href="#">'._mb("Interfaces").'</a></h3>';
+					$html .= '<div style="height:300px">';
+					break;
+				case "tabs":
+					$html .= '<div id="tabs-6">';
+					break;
+				case "plain":
+					$html .= '<h3>'._mb("Interfaces").'</h3>';
+					$html .= '<div>';
+					break;
+				default:
+					$html .= '<div>';
+					break;
 			}
-			if ($layout == 'tabs') {
-				$html .= '<div id="tabs-6">';
-			}
-			if ($layout == 'plain') {
-				$html .= '<h3>'._mb("Interfaces").'</h3>';
-				$html .= '<div>';
-			}
+			//$html .= '<p>';
 			$html .= '<fieldset><legend>'._mb("Online access").'</legend>';
 			$html .= $tableBegin;
 			$html .= $t_a."<b>".$iso19139Hash[4]['html']."</b>: ".$t_b."<a href='".$iso19139Hash[4]['value']."' target='_blank'>".$iso19139Hash[4]['value']."</a>".$t_c;
@@ -1047,19 +1118,17 @@
 			}
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
-			
 			$html .= '<fieldset><legend>'._mb("Metadata").'</legend>';
 			$html .= $tableBegin;
 			//exchange mdtype html with iso19139
 			//$queryNew = str_replace("mdtype=html","mdtype=iso19139",$_SERVER['QUERY_STRING']);
-			$html .= $t_a."<b>"._mb("ISO19139")."</b>: <a href='".$this->href."' target='_blank'>"._mb("Metadata")."</a>".$t_c;
-			$html .= $t_a."<b>"._mb("RDF")."</b>: <a href='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&outputFormat=rdf"."' target='_blank'>"._mb("Geo-DCAT Metadata")."</a>".$t_c;
+			$html .= $t_a."<b>"._mb("ISO19139")."</b>: ".$t_b."<a href='".$this->href."' target='_blank'>"._mb("Metadata")."</a>".$t_c;
+			$html .= $t_a."<b>"._mb("RDF")."</b>: ".$t_b."<a href='".$_SERVER['PHP_SELF']."?".$_SERVER['QUERY_STRING']."&outputFormat=rdf"."' target='_blank'>"._mb("Geo-DCAT Metadata")."</a>".$t_c;
 			//<a href='".$_SERVER['PHP_SELF']."?".$queryNew."&validate=true' target='_blank'><img style='border: none;' src = '../img/misc/icn_inspire_validate.png' title='"._mb("INSPIRE Validator")."'></a>
 			//push xml instead of html? But there is no real url
 			$html .= $tableEnd;
 			$html .= '</fieldset>';
-			$html .= '</p>';
+			//$html .= '</p>';
 			$html .= '</div>';//element
 			//***************************************************************************
 			$html .= '</div>'; //accordion
@@ -1069,7 +1138,25 @@
 			return $html;
 		}
 	}
-
+	
+	private function getHtmlRow($t_a, $t_b, $t_c, $iso19139Hash, $isoHashIndex){
+		$stringToReturn = $t_a."<b>".$iso19139Hash[$isoHashIndex]['html']."</b>: ".$t_b."<p ";
+		if (!isset($iso19139Hash[$isoHashIndex]['content']) && isset($iso19139Hash[$isoHashIndex]['property'])) {
+			$iso19139Hash[$isoHashIndex]['content'] = $iso19139Hash[$isoHashIndex]['value'];
+		}
+		if (isset($iso19139Hash[$isoHashIndex]['property'])) {
+			$stringToReturn .= ' property="'.$iso19139Hash[$isoHashIndex]['property'].'"';
+		}
+		if (isset($iso19139Hash[$isoHashIndex]['content'])) {
+			$stringToReturn .= ' content="'.$iso19139Hash[$isoHashIndex]['content'].'"';
+		}
+		if (isset($iso19139Hash[$isoHashIndex]['datatype'])) {
+			$stringToReturn .= ' datatype="'.$iso19139Hash[$isoHashIndex]['datatype'].'"';
+		}
+		$stringToReturn .= ">".$iso19139Hash[$isoHashIndex]['value']."</p>".$t_c;
+		return $stringToReturn;
+	}
+	
 	private function parseExteriorPolygon($gml3Polygon) {
 		//cause postgis gives back polygons without namspace, we have to add a namespace before parsing the xml again :-(
 		$gml3Polygon = "<?xml version=\"1.0\" encoding=\"utf-8\" ?>".$gml3Polygon;

Added: trunk/mapbender/http/geoportal/xslt/dcat-ap-rdf2rdfa.xsl
===================================================================
--- trunk/mapbender/http/geoportal/xslt/dcat-ap-rdf2rdfa.xsl	                        (rev 0)
+++ trunk/mapbender/http/geoportal/xslt/dcat-ap-rdf2rdfa.xsl	2017-12-06 16:19:28 UTC (rev 9825)
@@ -0,0 +1,426 @@
+<?xml version="1.0" encoding="utf-8" ?>
+
+<!--  
+
+  Copyright 2015-2017 EUROPEAN UNION
+  Licensed under the EUPL, Version 1.1 or - as soon they will be approved by
+  the European Commission - subsequent versions of the EUPL (the "Licence");
+  You may not use this work except in compliance with the Licence.
+  You may obtain a copy of the Licence at:
+ 
+  http://ec.europa.eu/idabc/eupl
+ 
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the Licence is distributed on an "AS IS" basis,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the Licence for the specific language governing permissions and
+  limitations under the Licence.
+ 
+  Authors: European Commission, Joint Research Centre (JRC)
+           Andrea Perego <andrea.perego at ec.europa.eu>
+ 
+  This work was supported by the EU Interoperability Solutions for
+  European Public Administrations Programme (http://ec.europa.eu/isa)
+  through Action 1.17: Re-usable INSPIRE Reference Platform 
+  (http://ec.europa.eu/isa/actions/01-trusted-information-exchange/1-17action_en.htm).
+
+-->
+
+<!--
+
+  PURPOSE AND USAGE
+
+  This XSLT is a proof of concept for the HTML+RDFa representation of metadata 
+  based on DCAT-AP, and related extensions (as GeoDCAT-AP). The DCAT-AP 
+  specification is available on Joinup, the collaboration platform of the 
+  EU ISA Programme:
+  
+    https://joinup.ec.europa.eu/node/63567/
+    
+  As such, this XSLT must be considered as unstable, and can be updated any 
+  time based on the revisions to the DCAT-AP specification and related 
+  extensions.
+  
+  The official distributions of this XSLT are published in the European 
+  Commission's Stash repository:
+  
+    https://webgate.ec.europa.eu/CITnet/stash/projects/ODCKAN/repos/dcat-ap-rdf2html
+
+  Comments and inquiries should be sent to the GeoDCAT-AP WG mailing list: 
+
+    dcat_application_profile-geo at joinup.ec.europa.eu
+  
+-->
+
+<xsl:transform
+    xmlns:dcat    = "http://www.w3.org/ns/dcat#"
+    xmlns:dcterms = "http://purl.org/dc/terms/"
+    xmlns:dctype  = "http://purl.org/dc/dcmitype/"
+    xmlns:foaf    = "http://xmlns.com/foaf/0.1/"
+    xmlns:rdf     = "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+    xmlns:rdfs    = "http://www.w3.org/2000/01/rdf-schema#"
+    xmlns:vcard   = "http://www.w3.org/2006/vcard/ns#"
+    xmlns:xsl     = "http://www.w3.org/1999/XSL/Transform"
+    version="1.0">
+
+  <xsl:output method="html"
+              doctype-system="about:legacy-compact"
+              media-type="text/html"
+              omit-xml-declaration="yes"
+              encoding="UTF-8"
+              exclude-result-prefixes="#all"
+              indent="yes" />
+
+<!-- Global parameters -->  
+
+<!-- The URL of the repository hosting the XSLT source code -->
+
+  <xsl:param name="home">https://webgate.ec.europa.eu/CITnet/stash/projects/ODCKAN/repos/dcat-ap-html</xsl:param>
+
+<!-- The title of the resulting HTML page. 
+     This information can  be passed as a parameter by the XSLT 
+     processor used. -->
+
+  <xsl:param name="title">
+    <xsl:choose>
+      <xsl:when test="/rdf:RDF/rdf:Description[@rdf:about='']">
+        <xsl:choose>
+          <xsl:when test="/rdf:RDF/rdf:Description/dcterms:title">
+            <xsl:value-of select="/rdf:RDF/rdf:Description/dcterms:title"/>
+          </xsl:when>
+          <xsl:when test="/rdf:RDF/rdf:Description/rdfs:label">
+            <xsl:value-of select="/rdf:RDF/rdf:Description/rdfs:label"/>
+          </xsl:when>
+          <xsl:otherwise>
+            <xsl:text>DCAT-AP in HTML+RDFa</xsl:text>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:text>DCAT-AP in HTML+RDFa</xsl:text>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:param>
+
+<!-- The footer of the resulting HTML page. 
+     This information can  be passed as a parameter by the XSLT 
+     processor used. -->
+
+  <xsl:param name="footer">
+    <p><xsl:value-of select="$title"/><xsl:text> @ Stash: </xsl:text><a href="{$home}"><xsl:value-of select="$home"/></a></p>
+  </xsl:param>
+
+<!-- Use this parameter to specify the set of LINK, STYLE, SCRIPT
+     elements to be added to the HEAD of the resulting HTML document.
+     This information can  be passed as a parameter by the XSLT 
+     processor used. -->
+
+  <xsl:param name="head"/>
+
+<!-- Namespace URIs -->
+
+  <xsl:param name="rdf">http://www.w3.org/1999/02/22-rdf-syntax-ns#</xsl:param>
+
+<!-- Class to be used to type untyped blank nodes -->  
+  
+  <xsl:param name="bnodeClass">
+    <rdfs:Resource/>
+  </xsl:param>
+  <xsl:param name="bnodeClassName" select="name(document('')/*/xsl:param[@name='bnodeClass']/*)"/>
+  <xsl:param name="bnodeClassURI" select="concat(namespace-uri(document('')/*/xsl:param[@name='bnodeClass']/*),local-name(document('')/*/xsl:param[@name='bnodeClass']/*))"/>
+
+<!-- Main template -->  
+  
+  <xsl:template match="/">
+  
+    <xsl:param name="DatasetNr" select="count(rdf:RDF/dcat:Dataset|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Dataset'])"/>
+    <xsl:param name="ServiceNr" select="count(rdf:RDF/dcat:Catalog|rdf:RDF/dctype:Service|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Catalog' or rdf:type/@rdf:resource='http://purl.org/dc/dcmitype/Service'])"/>
+
+<html>
+  <head>
+    <title><xsl:value-of select="$title"/></title>
+    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
+    <xsl:value-of select="$head" disable-output-escaping="yes"/>
+  </head>
+  <body>
+    <header><h1><xsl:value-of select="$title"/></h1></header>
+    <nav>
+    </nav>
+    <section>
+      <h1>Summary</h1>
+      <dl>
+        <dt>Datasets</dt>
+        <dd><xsl:value-of select="$DatasetNr"/></dd>
+        <dt>Services</dt>
+        <dd><xsl:value-of select="$ServiceNr"/></dd>
+      </dl>
+    </section>
+    <xsl:apply-templates select="rdf:RDF/dcat:Dataset|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Dataset']"/>
+    <xsl:apply-templates select="rdf:RDF/dcat:Catalog|rdf:RDF/dctype:Service|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Catalog' or rdf:type/@rdf:resource='http://purl.org/dc/dcmitype/Service']"/>
+<!--    
+    <section>
+      <h1>Datasets (<xsl:value-of select="count(rdf:RDF/dcat:Dataset|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Dataset'])"/>)</h1>
+      <xsl:apply-templates select="rdf:RDF/dcat:Dataset|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Dataset']"/>
+    </section>
+    <section>
+      <h1>Services (<xsl:value-of select="count(rdf:RDF/dcat:Catalog|rdf:RDF/dctype:Service|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Catalog' or rdf:type/@rdf:resource='http://purl.org/dc/dcmitype/Service'])"/>)</h1>
+      <xsl:apply-templates select="rdf:RDF/dcat:Catalog|rdf:RDF/dctype:Service|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Catalog' or rdf:type/@rdf:resource='http://purl.org/dc/dcmitype/Service']"/>
+    </section>
+-->    
+    <aside>
+    </aside>
+    <footer>
+      <xsl:copy-of select="$footer"/>
+    </footer>
+  </body>
+</html>
+    
+  </xsl:template>
+
+  <xsl:template name="Dataset" match="rdf:RDF/dcat:Dataset|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Dataset']">
+    <section class="record">
+      <h1>Dataset: <span xml:lang="{dcterms:title/@xml:lang}" lang="{dcterms:title/@xml:lang}"><xsl:value-of select="dcterms:title"/></span></h1>
+      <xsl:call-template name="Agent"/>
+      <p xml:lang="{dcterms:description/@xml:lang}" lang="{dcterms:description/@xml:lang}"><xsl:value-of select="dcterms:description"/></p>
+      <xsl:call-template name="metadata"/>
+    </section>
+  </xsl:template>
+
+  <xsl:template name="Service" match="rdf:RDF/dcat:Catalog|rdf:RDF/dctype:Service|rdf:RDF/rdf:Description[rdf:type/@rdf:resource='http://www.w3.org/ns/dcat#Catalog' or rdf:type/@rdf:resource='http://purl.org/dc/dcmitype/Service']">
+    <section class="record">
+      <h1>Service: <span xml:lang="{dcterms:title/@xml:lang}" lang="{dcterms:title/@xml:lang}"><xsl:value-of select="dcterms:title"/></span></h1>
+      <xsl:call-template name="Agent"/>
+      <p xml:lang="{dcterms:description/@xml:lang}" lang="{dcterms:description/@xml:lang}"><xsl:value-of select="dcterms:description"/></p>
+      <xsl:call-template name="metadata"/>
+    </section>
+  </xsl:template>
+  
+  <xsl:template name="Agent">
+    <address>
+      <dl>
+        <xsl:for-each select="dcterms:publisher">
+          <xsl:variable name="org" select="*/foaf:name"/>
+          <xsl:variable name="email" select="*/foaf:mbox/@rdf:resource"/>
+          <xsl:variable name="url" select="*/foaf:workplaceHomepage/@rdf:resource"/>
+          <xsl:variable name="name" select="$org"/>
+          <dt>Publisher</dt>
+          <dd>
+          <xsl:choose>
+            <xsl:when test="$url != ''">
+              <a href="{$url}"><xsl:value-of select="$name"/></a>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$name"/>
+            </xsl:otherwise>
+          </xsl:choose>
+          <xsl:if test="$email != ''">
+            <xsl:text> (</xsl:text><a href="{$email}"><xsl:value-of select="substring-after($email, 'mailto:')"/></a><xsl:text>)</xsl:text>
+          </xsl:if>
+          </dd>
+        </xsl:for-each>
+        <xsl:for-each select="dcat:contactPoint">
+          <xsl:variable name="individual" select="*/vcard:fn"/>
+          <xsl:variable name="org" select="*/vcard:organization-name"/>
+          <xsl:variable name="email" select="*/vcard:hasEmail/@rdf:resource"/>
+          <xsl:variable name="url" select="*/vcard:hasURL/@rdf:resource"/>
+          <xsl:variable name="name">
+            <xsl:choose>
+              <xsl:when test="$individual != '' and $org != ''">
+                <xsl:value-of select="$individual"/>
+                <xsl:text>, </xsl:text>
+                <xsl:value-of select="$org"/>
+              </xsl:when>
+              <xsl:otherwise>
+                <xsl:value-of select="$individual"/>
+                <xsl:value-of select="$org"/>
+              </xsl:otherwise>
+            </xsl:choose>
+          </xsl:variable>
+          <dt>Contact point</dt>
+          <dd>
+          <xsl:choose>
+            <xsl:when test="$url != ''">
+              <a href="{$url}"><xsl:value-of select="$name"/></a>
+            </xsl:when>
+            <xsl:otherwise>
+              <xsl:value-of select="$name"/>
+            </xsl:otherwise>
+          </xsl:choose>
+          <xsl:if test="$email != ''">
+            <xsl:text> (</xsl:text><a href="{$email}"><xsl:value-of select="substring-after($email, 'mailto:')"/></a><xsl:text>)</xsl:text>
+          </xsl:if>
+          </dd>
+        </xsl:for-each>
+      </dl>
+    </address>
+  </xsl:template>
+  
+  <xsl:template name="metadata">
+    <section class="metadata">
+      <h2>Metadata</h2>
+        <details>
+          <summary>Details</summary>
+          <xsl:call-template name="subject"/>
+        </details>
+    </section>
+  </xsl:template>
+
+  <xsl:template name="subject">
+    <xsl:param name="ename">
+      <xsl:call-template name="setEname"/>  
+    </xsl:param>
+    <xsl:param name="predicate">
+      <xsl:call-template name="label"/>
+      <dd>
+      <xsl:for-each select="*">
+        <xsl:call-template name="predicate"/>
+      </xsl:for-each>
+      </dd>
+    </xsl:param>
+    <xsl:choose>
+      <xsl:when test="@rdf:about">
+        <dl about="{@rdf:about}" typeof="{$ename}">
+          <xsl:copy-of select="$predicate"/>
+        </dl>
+      </xsl:when>
+      <xsl:when test="@rdf:ID">
+        <dl about="#{@rdf:ID}" typeof="{$ename}">
+          <xsl:copy-of select="$predicate"/>
+        </dl>
+      </xsl:when>
+      <xsl:when test="@rdf:nodeID">
+        <dl typeof="{$ename}">
+          <xsl:copy-of select="$predicate"/>
+        </dl>
+      </xsl:when>
+      <xsl:otherwise>
+        <dl typeof="{$ename}">
+          <xsl:copy-of select="$predicate"/>
+        </dl>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="predicate">
+    <xsl:param name="ename">
+      <xsl:call-template name="setEname"/>  
+    </xsl:param>
+    <xsl:choose>
+<!-- Object properties -->    
+      <xsl:when test="(child::* and not(@rdf:parseType='Literal')) or @rdf:resource">
+        <dl rel="{$ename}">
+          <xsl:call-template name="label"/>
+          <xsl:choose>
+            <xsl:when test="@rdf:resource">
+              <dd><a resource="{@rdf:resource}" href="{@rdf:resource}"><xsl:value-of select="@rdf:resource"/></a></dd>
+            </xsl:when>
+            <xsl:when test="@rdf:parseType = 'Resource'">
+              <dd>
+                <dl typeof="{$bnodeClassURI}">
+                  <dt><xsl:value-of select="$bnodeClassName"/></dt>
+                  <dd>
+                  <xsl:for-each select="*">
+                    <xsl:call-template name="predicate"/>
+                  </xsl:for-each>
+                  </dd>
+                </dl>
+              </dd>
+            </xsl:when>
+            <xsl:otherwise>
+              <dd>
+                <xsl:for-each select="*">
+                  <xsl:call-template name="subject"/>
+                </xsl:for-each>
+              </dd>
+            </xsl:otherwise>
+          </xsl:choose>
+        </dl>
+      </xsl:when>
+<!-- Datatype properties -->      
+      <xsl:otherwise>
+        <dl>
+          <xsl:call-template name="label"/>
+          <xsl:choose>
+            <xsl:when test="@xml:lang">
+              <dd property="{$ename}" content="{.}" xml:lang="{@xml:lang}" lang="{@xml:lang}"><xsl:value-of select="."/></dd>
+            </xsl:when>
+            <xsl:when test="@rdf:datatype">
+              <dd property="{$ename}" content="{.}" datatype="{@rdf:datatype}"><code><xsl:value-of select="."/></code></dd>
+            </xsl:when>
+            <xsl:when test="@rdf:parseType = 'Literal'">
+              <dd property="{$ename}" content="{.}" datatype="{$rdf}XMLLiteral"><code><xsl:value-of select="."/></code></dd>
+            </xsl:when>
+            <xsl:otherwise>
+              <dd property="{$ename}" content="{.}"><xsl:value-of select="."/></dd>
+            </xsl:otherwise>
+          </xsl:choose>
+        </dl>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="label">
+    <xsl:param name="qname">
+      <xsl:call-template name="setQname"/>  
+    </xsl:param>
+    <xsl:choose>
+<!-- Object properties & individuals -->
+      <xsl:when test="child::* or @rdf:about or @rdf:resource">
+        <xsl:choose>
+          <xsl:when test="@rdf:parseType">
+            <dt><xsl:value-of select="$qname"/></dt>
+          </xsl:when>
+          <xsl:when test="@rdf:nodeID">
+            <dt><xsl:value-of select="$qname"/></dt>
+          </xsl:when>
+          <xsl:when test="@rdf:about">
+            <dt><a href="{@rdf:about}"><xsl:value-of select="@rdf:about"/></a><xsl:text> (</xsl:text><xsl:value-of select="$qname"/><xsl:text>)</xsl:text></dt>
+          </xsl:when>
+          <xsl:when test="@rdf:ID">
+            <dt><a href="#{@rdf:ID}"><xsl:value-of select="concat('#', at rdf:about)"/></a><xsl:text> (</xsl:text><xsl:value-of select="$qname"/><xsl:text>)</xsl:text></dt>
+          </xsl:when>
+          <xsl:otherwise>
+            <dt><xsl:value-of select="$qname"/></dt>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:when>
+<!-- Datatype properties, plain and typed literals -->      
+      <xsl:otherwise>
+        <xsl:choose>
+          <xsl:when test="@rdf:datatype">
+            <dt><xsl:value-of select="$qname"/><xsl:text> (</xsl:text><a href="{@rdf:datatype}"><xsl:value-of select="@rdf:datatype"/></a><xsl:text>)</xsl:text></dt>
+          </xsl:when>
+          <xsl:when test="@xml:lang">
+            <dt><xsl:value-of select="$qname"/><xsl:text> (</xsl:text><xsl:value-of select="@xml:lang"/><xsl:text>)</xsl:text></dt>
+          </xsl:when>
+          <xsl:otherwise>
+            <dt><xsl:value-of select="$qname"/></dt>
+          </xsl:otherwise>
+        </xsl:choose>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+  
+  <xsl:template name="setQname">
+    <xsl:choose>
+      <xsl:when test="name(.) = 'rdf:Description'">
+        <xsl:value-of select="$bnodeClassName"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="name(.)"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+  <xsl:template name="setEname">
+    <xsl:choose>
+      <xsl:when test="name(.) = 'rdf:Description'">
+        <xsl:value-of select="$bnodeClassURI"/>
+      </xsl:when>
+      <xsl:otherwise>
+        <xsl:value-of select="concat(namespace-uri(.),local-name(.))"/>
+      </xsl:otherwise>
+    </xsl:choose>
+  </xsl:template>
+
+</xsl:transform>

Modified: trunk/mapbender/http/php/mod_layerISOMetadata.php
===================================================================
--- trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-12-01 11:46:27 UTC (rev 9824)
+++ trunk/mapbender/http/php/mod_layerISOMetadata.php	2017-12-06 16:19:28 UTC (rev 9825)
@@ -55,7 +55,7 @@
 	$testMatch = NULL;
 }
 
-if ($_REQUEST['OUTPUTFORMAT'] == "iso19139" || $_REQUEST['OUTPUTFORMAT'] == "rdf" || $_REQUEST['OUTPUTFORMAT'] == 'html') {
+if ($_REQUEST['OUTPUTFORMAT'] == "iso19139" || $_REQUEST['OUTPUTFORMAT'] == "rdf" || $_REQUEST['OUTPUTFORMAT'] == 'html' || $_REQUEST['OUTPUTFORMAT'] == 'html-rdf-a') {
 	//Initialize XML document
 	$iso19139Doc = new DOMDocument('1.0');
 	$iso19139Doc->encoding = 'UTF-8';
@@ -64,7 +64,7 @@
 	$outputFormat = $_REQUEST['OUTPUTFORMAT'];
 } else {
 	//echo 'outputFormat: <b>'.$_REQUEST['OUTPUTFORMAT'].'</b> is not set or valid.<br/>'; 
-	echo 'Parameter outputFormat is not set or valid (iso19139 | rdf | html).<br/>'; 
+	echo 'Parameter outputFormat is not set or valid (iso19139 | rdf | html | html-rdf-a).<br/>'; 
 	die();
 }
 
@@ -882,6 +882,12 @@
 	return $iso19139->transformToHtml();
 }
 
+function xml2html2($iso19139xml) {
+	$iso19139 = new Iso19139();
+	$iso19139->createMapbenderMetadataFromXML($iso19139xml);
+	return $iso19139->transformToHtml2();
+}
+
 function proxyFile($iso19139str,$outputFormat) {
 	switch ($outputFormat) {
 		case "rdf":
@@ -892,6 +898,10 @@
 			header("Content-type: text/html; charset=UTF-8");
 			echo xml2html($iso19139str);
 		break;
+		case "html-rdf-a":
+			header("Content-type: text/html; charset=UTF-8");
+			echo xml2html2($iso19139str);
+		break;
 		default:
 			header("Content-type: text/xml; charset=UTF-8");
 			echo $iso19139str;



More information about the Mapbender_commits mailing list