diff -rupN ./views_datasource/README.txt ./views_datasource_d7/README.txt
--- ./views_datasource/README.txt	2010-07-15 22:05:27.000000000 -0700
+++ ./views_datasource_d7/README.txt	2011-02-24 22:39:46.000000000 -0800
@@ -5,16 +5,12 @@ Views Datasource README
 
 Current Version
 ---------------
-6.x-1.0-BETA2
+7.x-dev
 
 Release Notes
 -------------
-Fixed:
-http://drupal.org/node/838264 Patch by levjj to add DOAP support to views_rdf
-http://drupal.org/node/844442 Views theme overriding now works as it should
-http://drupal.org/node/855166 author element is now included in Atom doc header
-http://drupal.org/node/847716: Closing tag of an XML element does not include
-xmlns or any additional attributes defined on the starting tag.
+Ported to Drupal 7 and added a JSON style that can be used to feed data
+into JqGrid (Hovhannes Tumanyan - hovhannes_tumanyan@yahoo.com)
  
 Upgrade Notes
 -------------
@@ -249,4 +245,4 @@ Properly handle grouped multiple values 
 Strict conformance with Atom spec
 Recognize when field rewriting rules are used
 Represent multiple-valued fields using nested child elements  
-     
\ No newline at end of file
+     
diff -rupN ./views_datasource/theme/views-views-json-style-jqgrid.tpl.php ./views_datasource_d7/theme/views-views-json-style-jqgrid.tpl.php
--- ./views_datasource/theme/views-views-json-style-jqgrid.tpl.php	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-json-style-jqgrid.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,42 @@
+<?php
+//$Id: views-views-json-jqgrid-simple.tpl.php Exp $
+/**
+ * @file views-views-json-style-simple.tpl.php
+ * Default template for the Views JSON style plugin using the jqGrid output format
+ * Based on the original simple format. Some tweaks added
+ *
+ * Variables:
+ * - $view: The View object.
+ * - $rows: Hierachial array of key=>value pairs to convert to JSON
+ * - $options: Array of options for this style 
+ *
+ * @ingroup views_templates
+ *
+ * Hovhannes Tumanyan (hovhannes_tumanyan@yahoo.com)
+ */
+
+$jsonp_prefix = $options['jsonp_prefix'];
+
+if ($view->override_path) {
+	// We're inside a live preview where the JSON is pretty-printed.
+	$json = _views_json_encode_formatted($rows);
+	if ($jsonp_prefix) $json = "$jsonp_prefix($json)";	
+	print "<code>$json</code>";
+}
+else {
+  $json = json_encode($rows);
+  if ($jsonp_prefix) $json = "$jsonp_prefix($json)";
+  if ($options['using_views_api_mode']) {
+    // We're in Views API mode.
+    print $json;
+  }
+  else {
+    // We want to send the JSON as a server response so switch the content
+    // type and stop further processing of the page.
+    $content_type = ($options['content_type'] == 'default') ? 'application/json' : $options['content_type'];
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
+    print $json;
+    //Don't think this is needed in .tpl.php files: module_invoke_all('exit');
+    exit;
+  }
+}
diff -rupN ./views_datasource/theme/views-views-json-style-simple.tpl.php ./views_datasource_d7/theme/views-views-json-style-simple.tpl.php
--- ./views_datasource/theme/views-views-json-style-simple.tpl.php	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-json-style-simple.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -21,6 +21,7 @@ if ($view->override_path) {
 	print "<code>$json</code>";
 }
 else {
+	//				var_dump($rows);
   $json = json_encode($rows);
   if ($jsonp_prefix) $json = "$jsonp_prefix($json)";
   if ($options['using_views_api_mode']) {
@@ -31,7 +32,7 @@ else {
     // We want to send the JSON as a server response so switch the content
     // type and stop further processing of the page.
     $content_type = ($options['content_type'] == 'default') ? 'application/json' : $options['content_type'];
-    drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $json;
     //Don't think this is needed in .tpl.php files: module_invoke_all('exit');
     exit;
diff -rupN ./views_datasource/theme/views_views_json_style.theme.inc ./views_datasource_d7/theme/views_views_json_style.theme.inc
--- ./views_datasource/theme/views_views_json_style.theme.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/theme/views_views_json_style.theme.inc	2011-02-24 22:36:58.000000000 -0800
@@ -14,10 +14,11 @@
  * @see views_json.views.inc
  */ 
 
-function template_preprocess_views_views_json_style_simple($vars) {	
+function template_preprocess_views_views_json_style_simple(&$vars) {	
   $view = $vars["view"];
   $rows = $vars["rows"];
   $options = $vars["options"];
+//var_dump($view); exit;
   $base = $view->base_table;
   $root_object = $options["root_object"];
   $top_child_object = $options["top_child_object"];
@@ -27,6 +28,7 @@ function template_preprocess_views_views
   	$object = array($top_child_object => array());
   	/*Convert the $rows into a hierachial key=>value array*/
   	foreach ($row as $field) {
+//echo "Field: "; var_dump($field);
   	  if ($options["field_output"] == "normal") {
   	  	if ($field->label)
   	  	  $label = $plaintext_output ? strip_tags($field->label) : $field->label;
@@ -38,6 +40,7 @@ function template_preprocess_views_views
         	$content = array();
         	foreach($field->content as $n=>$oc) $content[$n] = ($plaintext_output ? strip_tags($oc) : $oc);
         }
+//echo "Label is: $label\n";
   	  }
   	  elseif ($options["field_output"] == "raw") {
   	  	$label = $plaintext_output ? strip_tags($field->id) : $field->id;
@@ -53,11 +56,12 @@ function template_preprocess_views_views
   	}
   	$objects[] = $object;
   }	 
-  
+
+//echo " template preprocess" ;var_dump($objects);  
   $vars["rows"] = array($root_object => $objects);
 }
 
-function template_preprocess_views_views_json_style_exhibit($vars) {	
+function template_preprocess_views_views_json_style_exhibit(&$vars) {	
   $view = $vars["view"];
   $rows = $vars["rows"];
   $options = $vars["options"];
@@ -101,3 +105,64 @@ function template_preprocess_views_views
   $vars["rows"] = array($root_object => $objects); 
 }
 
+function template_preprocess_views_views_json_style_jqgrid(&$vars) {	
+//debug_print_backtrace(); exit;
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+//var_dump($view->query->pager); exit;
+  $base = $view->base_table;
+  $root_object = $options["root_object"];
+  $top_child_object = $options["top_child_object"];
+  $plaintext_output = $options["plaintext_output"];	
+  $objects = array();
+
+  foreach($rows as $row) {
+  	$object = array(); 
+  	foreach ($row as $field) {
+//echo "Field: "; var_dump($field);
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? strip_tags($field->label) : $field->label;
+  	  	else 
+		  $label = $plaintext_output ? strip_tags($field->id) : $field->id;  
+
+        if (!$field->is_multiple) {   	  	
+  	  	  $content = $plaintext_output ? strip_tags($field->content) : $field->content;
+        }
+        else {
+        	$content = array();
+        	foreach($field->content as $n=>$oc) $content[$n] = ($plaintext_output ? strip_tags($oc) : $oc);
+        }
+//echo "Label is: $label\n";
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? strip_tags($field->id) : $field->id;
+  	    if (!$field->is_multiple) {   	  	
+  	  	  $content = $plaintext_output ? strip_tags($field->raw) : $field->raw;
+        }
+        else {
+        	$content = array();
+        	foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? strip_tags($oc) : $oc;
+        }
+  	  }	
+  	  $object[$label] = $content;
+  	}
+  	$objects[] = $object;
+  }	 
+
+  if (isset($view->query->pager)){
+//	var_dump($view->query->pager); exit;
+	global $pager_total, $pager_total_items;	
+
+	$pagerId = $view->query->pager->options['id'];
+//	echo "Page: ".$pager_page[$pagerId].", pages: ".$pager_total[$pagerId].", items: ".$pager_total_items[$pagerId]; 
+	$very_top['page'] = $view->query->pager->current_page + 1;
+	$very_top['records'] = $pager_total_items[$pagerId];//100;//$view->query->pager->total_items;
+	$very_top['total'] = $pager_total[$pagerId];//$view->query->pager->options['total_pages'] != '' ? $view->query->pager->options['total_pages'] : 1;
+	$very_top['rows'] = $objects;
+  }
+
+//echo " template preprocess" ;var_dump($objects);  
+  $vars["rows"] = $very_top;//array($root_object => $objects);
+}
\ No newline at end of file
diff -rupN ./views_datasource/theme/views-views-rdf-style-doap.tpl.php ./views_datasource_d7/theme/views-views-rdf-style-doap.tpl.php
--- ./views_datasource/theme/views-views-rdf-style-doap.tpl.php	2010-07-15 21:39:03.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-rdf-style-doap.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -61,7 +61,7 @@ else if ($options['using_views_api_mode'
   print $xml;
 }
 else {
-  drupal_set_header("Content-Type: $content_type; charset=utf-8");
+  drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
   print $xml;
   exit;
 }
diff -rupN ./views_datasource/theme/views-views-rdf-style-doap.tpl.php~ ./views_datasource_d7/theme/views-views-rdf-style-doap.tpl.php~
--- ./views_datasource/theme/views-views-rdf-style-doap.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-rdf-style-doap.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,67 @@
+<?php
+// $Id: views-views-rdf-style-doap.tpl.php,v 1.1.2.1 2010/07/16 04:39:03 allisterbeharry Exp $
+/**
+ * @file views-views-rdf-style-doap.tpl.php
+ * Default template for the Views RDF style plugin using the DOAP vocabulary
+ *
+ * Variables
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_rdf_render_fields
+ * - $projects Array of project objects as created by template_preprocess_views_views_rdf_style_doap
+ *
+ * @ingroup views_templates
+ */
+global $base_url;
+$content_type = ($options['content_type'] == 'default') ? 'application/rdfxml' : $options['content_type'];
+if (!$header) { //build our own header
+  $xml .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+  $xml .= '<!-- generator="Drupal Views_Datasource.Module" -->'."\n";
+  $xml .= '<rdf:RDF xmlns="http://usefulinc.com/ns/doap#"'."\n";
+  $xml .= '  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n";
+  $xml .= '  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"'."\n";
+  $xml .= '  xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
+  $xml .= '  xmlns:foaf="http://xmlns.com/foaf/0.1/"'."\n";
+  $xml .= '  xmlns:doap="http://usefulinc.com/ns/doap#">'."\n";
+}
+else {
+  $xml .= "  $header\n";
+}
+foreach($projects as $nid => $project) {
+  $xml .= "<doap:Project rdf:about=\"".$project["homepage"]."\">\n";
+  if (array_key_exists("homepage", $project)) {
+    $xml .= "  <doap:homepage rdf:resource=\"".$project["homepage"]."\"/>\n";
+  }
+  if (array_key_exists("name", $project)) {
+    $xml .= "  <doap:name>".$project["name"]."</doap:name>\n";
+  }
+  if (array_key_exists("shortdesc", $project)) {
+    $xml .= "  <doap:shortdesc>".$project["shortdesc"]."</doap:shortdesc>\n";
+  }
+  if (array_key_exists("license", $project)) {
+    $xml .= "  <doap:license rdf:resource=\"http://usefulinc.com/doap/licenses/".$project["license"]."\"/>\n";
+  }
+  if (array_key_exists("language", $project)) {
+    $xml .= "  <programming-language>".$project["language"]."</programming-language>\n";
+  }
+  foreach ($project["repositories"] as $repository) {
+    $xml .= "  <repository><Repository><location rdf:resource=\"";
+    $xml .= $repository."\"/></Repository></repository>\n";
+  }
+  foreach ($project["developers"] as $developer) {
+    $xml .= "  <developer><foaf:Person><foaf:name>".$developer;
+    $xml .= "</foaf:name></foaf:Person></developer>\n";
+  }
+  $xml .= "</doap:Project>\n";
+}
+$xml .= "</rdf:RDF>\n";
+if ($view->override_path) {       // inside live preview
+  print htmlspecialchars($xml);
+}
+else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+  print $xml;
+}
+else {
+  drupal_set_header("Content-Type: $content_type; charset=utf-8");
+  print $xml;
+  exit;
+}
diff -rupN ./views_datasource/theme/views-views-rdf-style-foaf.tpl.php ./views_datasource_d7/theme/views-views-rdf-style-foaf.tpl.php
--- ./views_datasource/theme/views-views-rdf-style-foaf.tpl.php	2010-06-06 20:27:07.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-rdf-style-foaf.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -14,8 +14,9 @@
 
 //_views_rdf_debug_stop($persons);
 global $base_url;
+$xml = "";
 $content_type = ($options['content_type'] == 'default') ? 'application/rdf+xml' : $options['content_type'];
-if (!$header) { //build our own header
+if (empty($header) || !$header) { //build our own header
   $xml .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
   $xml .= '<!-- generator="Drupal Views_Datasource.Module" -->'."\n";
   $xml .= '<rdf:RDF xmlns="http://xmlns.com/foaf/0.1"'."\n";
@@ -58,7 +59,7 @@ foreach($persons as $person) {
     print $xml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+  	drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xml;
     exit;
   } 
diff -rupN ./views_datasource/theme/views-views-rdf-style-foaf.tpl.php~ ./views_datasource_d7/theme/views-views-rdf-style-foaf.tpl.php~
--- ./views_datasource/theme/views-views-rdf-style-foaf.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-rdf-style-foaf.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,64 @@
+<?php
+// $Id: views-views-rdf-style-foaf.tpl.php,v 1.1.2.4 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-rdf-style-foaf.tpl.php
+ * Default template for the Views RDF style plugin using the FOAF vocabulary
+ *
+ * Variables
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_rdf_render_fields
+ * - $persons Array of person objects as created by template_preprocess_views_views_rdf_style_foaf 
+ *
+ * @ingroup views_templates
+ */
+
+//_views_rdf_debug_stop($persons);
+global $base_url;
+$content_type = ($options['content_type'] == 'default') ? 'application/rdf+xml' : $options['content_type'];
+if (empty($header) || !$header) { //build our own header
+  $xml .= '<?xml version="1.0" encoding="UTF-8" ?>'."\n";
+  $xml .= '<!-- generator="Drupal Views_Datasource.Module" -->'."\n";
+  $xml .= '<rdf:RDF xmlns="http://xmlns.com/foaf/0.1"'."\n";
+  $xml .= '  xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"'."\n";
+  $xml .= '  xmlns:rdfs="http://www.w3.org/2000/01/rdf-schema#"'."\n";
+  $xml .= '  xmlns:dc="http://purl.org/dc/elements/1.1/"'."\n";
+  $xml .= '  xmlns:foaf="http://xmlns.com/foaf/0.1/">'."\n";
+}
+else {
+	$xml .= "  $header\n";
+}
+foreach($persons as $person) {
+ 	$xml .= "<foaf:Person>\n";
+ 	if (array_key_exists("name", $person))              $xml .= "  <foaf:name>".$person["name"]."</foaf:name>\n";
+ 	if (array_key_exists("firstName", $person))         $xml .= "  <foaf:firstName>".$person["firstName"]."</foaf:firstName>\n";
+ 	if (array_key_exists("surName", $person))           $xml .= "  <foaf:surName>".$person["surName"]."</foaf:surName>\n";
+ 	if (array_key_exists("title", $person))             $xml .= "  <foaf:title>".$person["title"]."</foaf:title>\n";
+ 	if (array_key_exists("nick", $person))              $xml .= "  <foaf:nick>".$person["nick"]."</foaf:nick>\n";
+ 	if (array_key_exists("mbox", $person))              $xml .= "  <foaf:mbox rdf:resource=\"mailto:".$person["mbox"]."\">".$person["mbox"]."</foaf:mbox>\n";
+ 	if (array_key_exists("mbox_sha1sum", $person))      $xml .= "  <foaf:mbox_sha1sum>".$person["mbox_sha1sum"]."</foaf:mbox_sha1sum>\n";
+ 	if (array_key_exists("openid", $person))            $xml .= "  <foaf:openid>".$person["openid"]."</foaf:openid>\n";
+ 	if (array_key_exists("workplaceHomepage", $person)) $xml .= "  <foaf:workplaceHomepage rdf:resource=\"".$person["workplaceHomepage"]."\">".$person["workplacehomepage"]."</foaf:workplaceHomepage>\n";
+ 	if (array_key_exists("homepage", $person))          $xml .= "  <foaf:homepage rdf:resource=\"".$person["homepage"]."\">".$person["homepage"]."</foaf:homepage>\n";
+ 	if (array_key_exists("weblog", $person))            $xml .= "  <foaf:weblog rdf:resource=\"".$person["weblog"]."\">".$person["weblog"]."</foaf:weblog>\n";
+ 	if (array_key_exists("img", $person))               $xml .= "  <foaf:img rdf:resource=\"".$person["img"]."\">".$person["img"]."</foaf:img>\n";
+ 	if (array_key_exists("depiction", $person))         $xml .= "  <foaf:depiction>".$person["depiction"]."</foaf:depiction\n";
+ 	if (array_key_exists("member", $person))            $xml .= "  <foaf:openid>".$person["member"]."</foaf:member>\n";
+ 	if (array_key_exists("phone", $person))             $xml .= "  <foaf:phone>".$person["phone"]."</foaf:phone>\n";
+ 	if (array_key_exists("jabberID", $person))          $xml .= "  <foaf:jabberID>".$person["jabberID"]."</foaf:jabberID>\n";
+ 	if (array_key_exists("msnChatID", $person))         $xml .= "  <foaf:msnChatID>".$person["msnChatID"]."</foaf:msnChatID>\n";
+ 	if (array_key_exists("aimChatID", $person))         $xml .= "  <foaf:aimChatID>".$person["aimChatID"]."</foaf:aimChatID>\n";
+ 	if (array_key_exists("yahooChatID", $person))       $xml .= "  <foaf:yahooChatID>".$person["yahooChatID"]."</foaf:yahooChatID>\n";
+  $xml .= "</foaf:Person>\n";
+ }
+ $xml .= "</rdf:RDF>\n";
+ if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xml);
+ }
+ else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xml;
+  }
+  else {
+  	drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
+    print $xml;
+    exit;
+  } 
diff -rupN ./views_datasource/theme/views-views-rdf-style-sioc.tpl.php ./views_datasource_d7/theme/views-views-rdf-style-sioc.tpl.php
--- ./views_datasource/theme/views-views-rdf-style-sioc.tpl.php	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-rdf-style-sioc.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -114,7 +114,7 @@ if ($users) {
     print $xml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xml;
     exit;
   }   
diff -rupN ./views_datasource/theme/views-views-rdf-style-sioc.tpl.php~ ./views_datasource_d7/theme/views-views-rdf-style-sioc.tpl.php~
--- ./views_datasource/theme/views-views-rdf-style-sioc.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-rdf-style-sioc.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,120 @@
+<?php
+// $Id: views-views-rdf-style-sioc.tpl.php,v 1.1.2.5 2010/07/15 07:34:48 allisterbeharry Exp $$
+/**
+ * @file views-views-rdf-style-sioc.tpl.php
+ * Default template for the Views RDF style plugin using the SIOC vocabulary
+ *
+ * Variables:
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields
+ * - $nodes, $users Array of user and node objects created by template_preprocess_views_views_rdf_style_sioc 
+ *
+ * @ingroup views_templates
+ */
+
+//_views_rdf_debug_stop($nodes);
+global $base_url;
+$content_type = ($options['content_type'] == 'default') ? 'application/rdf+xml' : $options['content_type'];
+if (!$header) { //build our own header
+  $xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
+  $xml .= '<!-- generator="Drupal Views Datasource Module" -->'."\n";
+  $xml .= "<rdf:RDF\r\n";
+  $xml .= "  xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\"\r\n";
+  $xml .= "  xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\"\r\n";
+  $xml .= "  xmlns:sioc=\"http://rdfs.org/sioc/ns#\"\r\n";
+  $xml .= "  xmlns:sioct=\"http://rdfs.org/sioc/terms#\"\r\n";
+  $xml .= "  xmlns:dc=\"http://purl.org/dc/elements/1.1/\"\r\n";
+  $xml .= "  xmlns:dcterms=\"http://purl.org/dc/terms/\"\r\n";
+  $xml .= "  xmlns:admin=\"http://webns.net/mvcb/\"\r\n";
+  $xml .= "  xmlns:foaf=\"http://xmlns.com/foaf/0.1/\">\r\n";
+}
+if ($users) {
+ if (!$nodes) { //Document is about users
+   $xml .= "<foaf:Document rdf:about=\"". url($view->name, array('absolute' => TRUE)) ."\">\n";
+   $xml .= "  <dc:title>SIOC user profiles for: ". variable_get('site_name', 'drupal') ."</dc:title>\n";
+   $xml .= "  <dc:description>\n";
+   $xml .= "    A User is an online account of a member of an online community. ";
+   $xml .= "It is connected to Items and Posts that a User creates or edits, ";
+   $xml .= "to Containers and Forums that it is subscribed to or moderates and ";
+   $xml .= "to Sites that it administers. Users can be grouped for purposes of ";
+   $xml .= "allowing access to certain Forums or enhanced community site features (weblogs, webmail, etc.).";
+   $xml .= "A foaf:Person will normally hold a registered User account on a Site ";
+   $xml .= "(through the property foaf:holdsAccount), and will use this account ";
+   $xml .= "to create content and interact with the community. sioc:User describes ";
+   $xml .= "properties of an online account, and is used in combination with a ";
+   $xml .= "foaf:Person (using the property sioc:account_of) which describes ";
+   $xml .= "information about the individual itself.\n";
+   $xml .= "  </dc:description>\n";
+   $xml .= "####foaf_topics####\n";
+   $xml .= "  <admin:generatorAgent rdf:resource=\"http://drupal.org/project/views_datasource\"/>\n";
+   $xml .= "</foaf:Document>\n";
+   foreach($users as $user) {
+     $uid = $user["uid"];
+     $user_name = $user["name"];
+     $email = $user["mail"];
+     $xml .="<foaf:Person rdf:about=\"". url('user/'. $uid, array('absolute' => TRUE)) ."\">\n";
+     $xml .="  <foaf:name>$user_name</foaf:name>\n";
+     $xml .="  <foaf:mbox_sha1sum>". md5('mailto:'. $email) ."</foaf:mbox_sha1sum>\n";
+     $xml .="  <foaf:holdsAccount>\n";
+     $xml .="    <sioc:User rdf:nodeID=\"$uid\">\n";
+     $xml .="      <sioc:name>$user_name</sioc:name>\n";
+     $xml .="      <sioc:email rdf:resource=\"mailto:$email\"/>\n";
+     $xml .="      <sioc:email_sha1>". md5('mailto:'. $email) ."</sioc:email_sha1>\n";
+     $xml .="      <sioc:link rdf:resource=\"". url('user/'. $uid, array('absolute' => TRUE)) ."\" rdfs:label=\"$user_name\"/>\n";
+     $roles = array();
+     $roles_query = db_query("SELECT r.name AS name, r.rid AS rid FROM {users_roles} ur, {role} r WHERE ur.uid = %d AND ur.rid = r.rid", $uid);
+     while ($role = db_fetch_object($roles_query)) $roles[$role->rid] = $role->name;
+       if (count($roles) > 0) {
+         $xml .="      <sioc:has_function>\n";
+         foreach ($roles as $rid => $name) $xml .="        <sioc:Role><rdfs:label><![CDATA[$name]]></rdfs:label></sioc:Role>\n";
+         $xml .="      </sioc:has_function>\n";
+       }
+       $xml .="    </sioc:User>\n";
+       $xml .="  </foaf:holdsAccount>\n";
+       $xml .="</foaf:Person>\n";
+    }  
+  }
+}
+ 
+ if ($nodes) {
+ 	$users_xml = "";
+ 	$nodes_xml = "";
+ 	$users_done = array();
+ 	$count = 0;
+ 	foreach($nodes as $node) {
+ 		
+ 		if ((array_key_exists("id", $node)) && (array_key_exists("title", $node)) && (array_key_exists("type", $node)) 
+ 		  && (array_key_exists("created", $node)) && (array_key_exists("changed", $node)) && (array_key_exists("last_updated", $node)) 
+ 		  && (array_key_exists("uid", $node)) && (array_key_exists("body", $node))) {
+ 		  if (array_key_exists($node["id"], $users) && (!array_key_exists($node["uid"], $users_done))) {
+ 		  	$user = $users[$node["id"]];
+ 		  	$users_done[$node["uid"]] = $user;
+ 		  	$users_xml .=  _views_rdf_sioc_xml_user_render($user);
+ 		  }
+      $nodes_xml .= _views_rdf_sioc_xml_story_render($node["id"], $node["title"], $node["type"], $node["created"], $node["changed"], $node["last_updated"], $node["uid"], $node["body"]); 		  
+    }
+    else {
+    	$nid = $node["id"];
+    	$nodes_xml .= "<missing> node $nid is missing one or more of the id, title, type, created, changed, last_updated, uid, or body attributes.</missing>";
+//      if ($view->override_path)
+//        print '<b style="color:red">One of the id, title, type, created, changed, lasty_updated, uid, and body attributes is missing.</b>';
+//      elseif ($options['using_views_api_mode'])
+//        print "One of the id, title, type, created, changed, lasty_updated, uid, and body attributes is missing.";   
+//      else drupal_set_message(t('One of the id, title, type, created, changed, lasty_updated, uid, and body attributes is missing.'), 'error');
+//      return;
+    }    
+  }//for
+}//if
+ $xml .= $users_xml.$nodes_xml;
+ $xml .= "</rdf:RDF>\n";
+ if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xml);
+ }
+ else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xml;
+  }
+  else {
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xml;
+    exit;
+  }   
diff -rupN ./views_datasource/theme/views_views_rdf_style.theme.inc ./views_datasource_d7/theme/views_views_rdf_style.theme.inc
--- ./views_datasource/theme/views_views_rdf_style.theme.inc	2010-07-15 21:39:03.000000000 -0700
+++ ./views_datasource_d7/theme/views_views_rdf_style.theme.inc	2011-02-24 22:36:58.000000000 -0800
@@ -19,7 +19,7 @@
  * @param $vars
  * @return unknown_type
  */
-function template_preprocess_views_views_rdf_style_foaf($vars) {
+function template_preprocess_views_views_rdf_style_foaf(&$vars) {
 	global $user;
 	global $base_url; 
   $view = $vars["view"];
@@ -35,7 +35,7 @@ function template_preprocess_views_views
   $plaintext_output = $options["plaintext_output"];
   $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atom+rdf' : $options['content_type'];
   $header  = $options["header"];
-  if (!$vars["header"]) {
+  if (empty($vars["header"]) || !$vars["header"]) {
   	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
   	$vars["id"] = check_url($view->get_url());
   	$vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
@@ -88,6 +88,7 @@ function template_preprocess_views_views
       }
       if (stripos($label, 'nick') !== FALSE) {
         $person["nick"] = check_plain($content);
+//echo "Nick is ".$person["nick"];
         continue;
       }
       if ((stripos($label, 'mbox') !== FALSE) && !(stripos($label, 'mbox_sha1sum') !== FALSE)) {
@@ -155,6 +156,7 @@ function template_preprocess_views_views
         continue;
       }
     }  	
+//echo "Added person"; var_dump($person);
 	  $persons[] = $person; 
   }//for
   $vars["persons"] = $persons;  
@@ -165,7 +167,7 @@ function template_preprocess_views_views
  * @param $vars
  * @return unknown_type
  */
-function template_preprocess_views_views_rdf_style_sioc($vars) {
+function template_preprocess_views_views_rdf_style_sioc(&$vars) {
 	global $base_url; 
   $view = $vars["view"];
   $rows = $vars["rows"];
@@ -502,7 +504,7 @@ function _views_rdf_sioc_xml_story_rende
  * @param $vars
  * @return none
  */
-function template_preprocess_views_views_rdf_style_doap($vars) {
+function template_preprocess_views_views_rdf_style_doap(&$vars) {
   global $user;
   global $base_url; 
   $view = $vars["view"];
diff -rupN ./views_datasource/theme/views_views_rdf_style.theme.inc~ ./views_datasource_d7/theme/views_views_rdf_style.theme.inc~
--- ./views_datasource/theme/views_views_rdf_style.theme.inc~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views_views_rdf_style.theme.inc~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,618 @@
+<?php
+// $Id: views_views_rdf_style.theme.inc,v 1.1.2.6 2010/07/16 04:39:03 allisterbeharry Exp $
+
+/**
+ * @file
+ * View template to render view fields as rdf.
+ *
+ * - $view: The view in use.
+ * - $rows: Array of row objects as rendered by _views_json_render_fields 
+ * - $attachment: not used currently
+ * - $options: The options for the style passed in from the UI.
+ *
+ * @ingroup views_templates
+ * @see views_rdf.views.inc
+ */
+
+/**
+ * Template preprocess for the FOAF vocabulary
+ * @param $vars
+ * @return unknown_type
+ */
+function template_preprocess_views_views_rdf_style_foaf($vars) {
+	global $user;
+	global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+	$base = $view->base_table;
+  $root = "feed";
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atom+rdf' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+  	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+  	$vars["id"] = check_url($view->get_url());
+  	$vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
+  	$vars["author"] = _views_rdf_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  } else $vars["header"] = $header;
+	$persons = array();
+  foreach($rows as $row) {
+  	$person = array();
+  	foreach ($row as $field) {
+  		//_views_rdf_debug_stop($row);
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	else  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	  	if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+		    else {		    	
+		    	$content = array();
+		    	foreach($field->content as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    	$content = implode(" ", $content);
+		    }  	  	    	  	  
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	    if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+		    else { 
+		      $content = array();
+		      foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		      $content = implode(" ", $content);
+		    }  	  	  	  
+  	  }
+  	  //if (($options["skip_empty_fields"] == TRUE) && (is_null($content) || $content === "")) continue;  	  
+  	  if (stripos($label, 'firstname') !== FALSE) {
+        $person["firstName"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'surname') !== FALSE) {
+        $person["surName"] = check_plain($content);
+        continue;
+      }
+      if ((stripos($label, 'name') !== FALSE) && ((!stripos($label, 'firstname')) && (!stripos($label, 'surname')))) {
+      	$person["name"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'title') !== FALSE) {
+        $person["title"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'nick') !== FALSE) {
+        $person["nick"] = check_plain($content);
+        continue;
+      }
+      if ((stripos($label, 'mbox') !== FALSE) && !(stripos($label, 'mbox_sha1sum') !== FALSE)) {
+        $person["mbox"] = check_plain($content);
+        continue;
+      }
+      if (((stripos($label, 'mail') !== FALSE) || (stripos($label, 'email') !== FALSE)) && (!array_key_exists('mbox', $person))) {
+      	//_views_rdf_debug_stop($label);
+        $person["mbox"] = check_plain($content);
+        $person["mbox_sha1sum"] = md5("mailto:". check_plain($content));
+        continue;
+      }
+      if (stripos($label, 'mbox_sha1sum') !== FALSE) {
+        $person["mbox_sha1sum"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'openid') !== FALSE) {
+        $person["openid"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'workplaceHomepage') !== FALSE) {
+        $person["workplaceHomepage"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'homepage') !== FALSE) {
+        //$rdf .= '  <foaf:homepage rdf:resource="'. $value .'"/>'."\n";
+        $person["homepage"] = _views_rdf_strip_illegal_xml_attribute_value_chars(check_plain($content));
+        continue;
+      }
+      if (stripos($label, 'weblog') !== FALSE) {
+        //$rdf .= '  <foaf:weblog rdf:resource="'. $value .'"/>'."\n";
+        $person["weblog"] = _views_rdf_strip_illegal_xml_attribute_value_chars(check_plain($content));
+        continue;
+      }
+      if (stripos($label, 'img') !== FALSE) {
+        //$rdf .= '  <foaf:img rdf:resource="'. $value .'"/>'."\n";
+        //$rdf .= '  <foaf:depiction rdf:resource="'. $value .'"/>'."\n";
+        $person["img"] = _views_rdf_strip_illegal_xml_attribute_value_chars(check_plain($content));
+        continue;
+      }
+      if (stripos($label, 'member') !== FALSE) {
+        //$rdf .= "  <foaf:member>$value</foaf:member>\n";
+        $person["member"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'phone') !== FALSE) {
+        //$rdf .= "  <foaf:phone>$value</foaf:phone>\n";
+        $person["phone"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'jabberID') !== FALSE) {
+        $person["jabberID"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'msnChatID') !== FALSE) {
+        $person["msnChatID"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'aimChatID') !== FALSE) {
+        $person["aimChatID"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'yahooChatID') !== FALSE) {
+        $person["yahooChatID"] = check_plain($content);
+        continue;
+      }
+    }  	
+	  $persons[] = $person; 
+  }//for
+  $vars["persons"] = $persons;  
+}
+
+/**
+ * Template preprocess for the SIOC vocabulary
+ * @param $vars
+ * @return unknown_type
+ */
+function template_preprocess_views_views_rdf_style_sioc($vars) {
+	global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+	$base = $view->base_table;
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atom+rdf' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+  	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+  	$vars["id"] = check_url($view->get_url());
+  	$vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
+  	$vars["author"] = _views_rdf_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  } else $vars["header"] = $header;
+  $users = array();
+  $nodes = array();
+  if ($base == "users") {
+  	foreach ($rows as $row) {
+  		$user = array();
+  		foreach($row as $field) {
+  	    if ($options["field_output"] == "normal") {
+  	  	  if ($field->label)
+  	  	    $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	  else  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	  	  if (!$field->is_multiple) 
+		        $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+		      else {		    	
+		    	  $content = array();
+		    	  foreach($field->content as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    	  $content = implode(" ", $content);
+		      }  
+  	    }
+  	    elseif ($options["field_output"] == "raw") {
+  	  	  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	      if (!$field->is_multiple) 
+		        $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+		      else { 
+		        $content = array();
+		        foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		        $content = implode(" ", $content);
+		      }  	
+  	    }
+  		  if ((drupal_strtolower($label) == 'id') || (drupal_strtolower($label) == 'uid') && (!array_key_exists("uid", $user))) {
+          $user["uid"] = $content;
+          continue;
+        }
+        if ((drupal_strtolower($label) == 'name') || (drupal_strtolower($label) == 'users_name') && (!array_key_exists("name", $user))) {
+          $user["name"] = $content;
+          continue;
+        }
+        if ((drupal_strtolower($label) == 'mail') ||(drupal_strtolower($label) == 'email') || (drupal_strtolower($label) == 'users_mail') && (!array_key_exists("email", $user))) {
+          $user["mail"] = $content;
+          continue;
+        }  	     
+  	  }
+  	  $users[] = $user;
+  	}	
+  }    
+  if ($base == 'node') {
+    foreach ($rows as $row) {    
+      $node = array();
+      foreach($row as $field) {
+  	    if ($options["field_output"] == "normal") {
+  	      if ($field->label) 
+  	        $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	  else  
+  	  	    $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	  	  $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+  	    }
+  	    /* rdf:ID */			
+  	    if (!array_key_exists("id", $node)) {
+			    if (drupal_strtolower($label) == "id") {
+	  	      $node["id"] = $content;
+	  	      continue;
+	        }
+	  	  }
+	  	
+        /*use nid for rdf:ID if none specified*/
+	  	  if (!array_key_exists("id", $node)) {
+			    if (drupal_strtolower($label) == "nid") {
+	  	      $node["id"] = $content;
+	  	      continue;
+	        }
+	  	  }
+	  	
+        /* RDF:created*/
+	  	  if (!array_key_exists("created", $node)) {
+			    if (drupal_strtolower($label) == "created") {
+	  	      $node["created"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	
+	  	
+  	    /* rdf:created */			
+  	    if (!array_key_exists("created", $node)) {
+			    if((drupal_strtolower($label) == "node_created") || (drupal_strtolower($label) == "post date")){
+			    	//_views_rdf_debug_stop("created");
+	  	      $node["created"] = $content;
+	  	      continue;
+	        }
+	  	  }
+	  	
+        /* rdf:type */
+	  	  if (!array_key_exists("type", $node)) {
+			    if (drupal_strtolower($label) == "type") {
+	  	      $node["type"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	
+	  	
+  	    /* rdf:type */			
+  	    if (!array_key_exists("type", $node)) {
+			    if (drupal_strtolower($label) == "node_type") {
+	  	      $node["type"] = $content;
+	  	      continue;
+	        }
+	  	  }
+
+        /* rdf:changed */
+	  	  if (!array_key_exists("changed", $node)) {
+			    if (drupal_strtolower($label) == "changed") {
+	  	      $node["changed"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	
+	  	
+  	    /* use updatedcommented if no changed*/			
+  	      if (!array_key_exists("changed", $node)) {
+			      if ((drupal_strtolower($label) == "updated/commented date")) {
+	  	      $node["changed"] = $content;
+	  	      continue;
+	        }
+	  	  }
+	  	  
+        /* use node_changed if no changed*/			
+  	      if (!array_key_exists("changed", $node)) {
+			      if ((drupal_strtolower($label) == "node_changed")) {
+	  	      $node["changed"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	  
+
+        /* rdf:last updated */
+	  	  if (!array_key_exists("last_updated", $node)) {
+			    if (drupal_strtolower($label) == "last_updated") {
+	  	      $node["last_updated"] = $content;
+	  	      continue;
+	        }
+	  	  }
+
+        /* use lastupdateddate if no  last_updated */
+	  	  if (!array_key_exists("last_updated", $node)) {
+			    if ((drupal_strtolower($label) == "updated date")){
+	  	      $node["last_updated"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	
+	  	
+	  	
+  	    /* rdf:title */			
+  	    if (!array_key_exists("title", $node)) {
+			    if (drupal_strtolower($label) == "title") {
+	  	      $node["title"] = $content;
+	  	      continue;
+	        }
+	  	  }	  	
+	  	
+	  		  	
+  	    /* rdf title attribute */			
+  	    if (!array_key_exists("title", $node)) {
+			    if (drupal_strtolower($label) == "node_title") {
+	  	      $node["title"] = $content;
+	  	      continue;
+	        }
+	  	  }
+
+	  	  /* rdf body */
+	  	  if (!array_key_exists("body", $node)) {
+	        if (drupal_strtolower($label) == "body") {
+	      	  $node["body"] = $content;
+	        }
+	  	  }
+
+	  	  /* try node_revisions_body */
+	  	  if (!array_key_exists("body", $node)) {
+	        if (drupal_strtolower($label) == "node_revisions_body") {
+	      	  $node["body"] = $content;
+	        }
+	  	  }
+	  	  
+	  	  /* rdf uid */
+	  	  if (!array_key_exists("uid", $node)) {
+	        if (drupal_strtolower($label) == "uid") {
+	      	  $node["uid"] = $content;
+	        }
+	  	  }
+	  	  
+      	/* try users_uid for uid*/
+	  	  if (!array_key_exists("uid", $node)) {
+	        if (drupal_strtolower($label) == "users_uid") {
+	      	  $node["uid"] = $content;
+	        }
+	  	  }	
+      }
+      if (array_key_exists("uid", $node)) {
+	  	  	$user_obj = user_load($node["uid"]);
+	  	  	$user["uid"] = $user_obj->uid;
+	  	  	$user["name"] = $user_obj->name;
+	  	  	$user["mail"] = $user_obj->mail;
+	  	}	  	  
+      if ($node["id"]) {
+      	$nodes[$node["id"]] = $node;
+      	if ($user) $users[$node["id"]] = $user;
+      }
+      
+    }//for
+  }//if
+  $vars["nodes"] = $nodes;
+  $vars["users"] = $users;
+  
+  //_views_rdf_debug_stop($nodes);
+  //_views_rdf_debug_stop($users);
+  
+}
+function _views_rdf_sioc_xml_user_render($user) {
+  $xml .="<foaf:Person rdf:about=\"". url('user/'. $user["uid"], array('absolute' => TRUE)) ."\">\n";
+  $xml .="  <foaf:name>".$user["name"]."</foaf:name>\n";
+  $xml .="  <foaf:mbox_sha1sum>". md5('mailto:'. $user["mail"]) ."</foaf:mbox_sha1sum>\n";
+  $xml .="  <foaf:holdsAccount>\n";
+  $xml .="    <sioc:User rdf:nodeID=\"".$user["uid"]."\">\n";
+  $xml .="      <sioc:name>".$user["name"]."</sioc:name>\n";
+  $xml .="      <sioc:email rdf:resource=\"mailto:.".$user["mail"]."\"/>\n";
+  $xml .="      <sioc:email_sha1>". md5('mailto:'. $user["mail"]) ."</sioc:email_sha1>\n";
+  $xml .="      <sioc:link rdf:resource=\"". url('user/'. $user["uid"], array('absolute' => TRUE)) ."\" rdfs:label=\"".$user["name"]."\"/>\n";
+  $roles = array();
+  $roles_query = db_query("SELECT r.name AS name, r.rid AS rid FROM {users_roles} ur, {role} r WHERE ur.uid = %d AND ur.rid = r.rid", $user["uid"]);
+  while ($role = db_fetch_object($roles_query)) $roles[$role->rid] = $role->name;
+  if (count($roles) > 0) {
+    $xml .="      <sioc:has_function>\n";
+    foreach ($roles as $rid => $name)
+    $xml .="        <sioc:Role><rdfs:label><![CDATA[$name]]></rdfs:label></sioc:Role>\n";
+    $xml .="      </sioc:has_function>\n";
+  }
+  $xml .="    </sioc:User>\n";
+  $xml .="  </foaf:holdsAccount>\n";
+  $xml .="</foaf:Person>\n";
+  return $xml;
+}
+
+function _views_rdf_sioc_xml_story_render($nid, $title, $type, $created, $changed, $last_updated, $uid, $body) {
+	$node_url = url("node/$nid", array('absolute' => TRUE));
+	$xml = "";
+  $xml .= "<sioc:Post rdf:about=\"$node_url\">\n";
+  $xml .= "  <dc:title>$title</dc:title>\n";
+  $xml .= "  <sioc:content>\n ";
+  $xml .= "    <![CDATA[$body]]>\n";
+  $xml .= "  </sioc:content>\n";
+  //$xml .= "  <dc:created>". format_date(strtotime($created), 'custom', DATE_ISO8601) ."</dc:created>\n";
+  //$xml .= "  <dc:modified>". format_date(strtotime($changed), 'custom', DATE_ISO8601) ."</dc:modified>\n";
+  $xml .= "  <dc:created>". $created ."</dc:created>\n";
+  $xml .= "  <dc:modified>". $changed ."</dc:modified>\n";
+  $xml .= "  <sioc:link rdf:resource=\"$node_url\" rdfs:label=\"$title\" />\n";
+  $xml .= "  <sioc:has_creator rdf:nodeID=\"$uid\"/>\n";
+
+  /* Add taxonomy terms as SIOC topics */
+  $query = db_query('SELECT tn.tid AS tid, td.name AS name FROM {term_node} tn, {term_data} td WHERE td.tid = tn.tid AND tn.nid = %d', $nid);
+  while ($term = db_fetch_object($query)) {
+    $taxonomy_terms = "  <sioc:topic rdfs:label=\"$term->name\" rdf:resource=\"". url("taxonomy/term/$term->tid", array('absolute' => TRUE)) ."\" />\n";
+  }
+  $xml .= $taxonomy_terms;
+
+  /* Add comments as SIOC replies */
+  $query_count = 'SELECT COUNT(*) FROM {comments} WHERE nid = %d AND status = %d';
+  $query = 'SELECT c.cid as cid, c.pid, c.nid, c.subject, c.comment, c.format, c.timestamp, c.name, c.mail, c.homepage, u.uid, u.name AS registered_name, u.signature, u.picture, u.data, c.thread, c.status FROM {comments} c INNER JOIN {users} u ON c.uid = u.uid WHERE c.nid = %d and c.status = %d ORDER BY SUBSTRING(c.thread, 1, (LENGTH(c.thread) - 1))';
+  $query_args = array($nid, COMMENT_PUBLISHED);
+  $query = db_rewrite_sql($query, 'c', 'cid');
+  $comment_children = 0;
+  $num_rows = FALSE;
+  $comments = '';
+  $result = db_query($query, $query_args);
+  while ($comment = db_fetch_object($result)) {
+    $comment = drupal_unpack($comment);
+//    var_dump($comment);module_invoke_all('exit');return;
+//    $comment->depth = count(explode('.', $comment->thread)) - 1;
+//    if ($comment->depth > $comment_children) {
+//      $comment_children++;
+//      $comments .= "  <sioc:has_reply>\n";
+//    }
+//    else {
+//      while ($comment->depth < $comment_children) {
+//        $comment_children--;
+//        $comments .= "  </sioc:has_reply>\n";
+//      }
+//    }
+//    $comments .="     <sioc:Post rdf:about=\"$node_url#comment-$comment->cid\">\n";
+//    while ($comment_children-- > 0) {
+//      $num_rows = TRUE;
+//      $comments .="       <sioc:content><![CDATA[$comment->comment]]></sioc:content>\n";
+//      $comments .="     </sioc:Post>\n";
+//      $comments .= "  </sioc:has_reply>\n";
+//    }
+//  }
+    $comments .= "  <sioc:has_reply>\n";
+    $comments .= "    <sioc:Post rdf:about=\"$node_url#comment-$comment->cid\">\n";
+    if ($comment->subject) $comments .= "      <dc:title>$comment->subject</dc:title>\n";
+    if ($comment->timestamp) $comments .= "      <dc:created>". format_date($comment->timestamp, 'custom', DATE_ISO8601) ."</dc:created>\n";
+    if ($comment->uid) {
+      $comments .= "    <sioc:has_creator>\n";
+      $comments .= "      <sioc:User>\n";
+      $comments .= "        <sioc:name>$comment->registered_name</sioc:name>\n";
+      $comments .= "        <sioc:email rdf:resource=\"mailto:$comment->mail\"/>\n";
+      $comments .="         <sioc:link rdf:resource=\"". url('user/'. $comment->uid, array('absolute' => TRUE)) ."\" rdfs:label=\"$comment->registered_name\"/>\n";
+      $comments .= "      </sioc:User>\n";
+      $comments .= "    </sioc:has_creator>\n";
+    }
+    $comments .= "      <sioc:content><![CDATA[$comment->comment]]></sioc:content>\n";
+    $comments .= "    </sioc:Post>\n";
+    $comments .= "  </sioc:has_reply>\n";
+  }
+  $xml .= $comments;
+
+  $xml .= "</sioc:Post>\n";
+  return $xml;
+}
+
+/**
+ * Template preprocess for the DOAP vocabulary
+ * @param $vars
+ * @return none
+ */
+function template_preprocess_views_views_rdf_style_doap($vars) {
+  global $user;
+  global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+  $base = $view->base_table;
+  $root = "feed";
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atomrdf' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+    $vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+    $vars["id"] = check_url($view->get_url());
+    $vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
+    $vars["author"] = _views_rdf_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  }
+  else {
+    $vars["header"] = $header;
+  }
+  $projects = array();
+  foreach($rows as $row) {
+    if (array_key_exists($row["nid"], $projects)) {
+      $project = $projects[$row["nid"]];
+    }
+    else {
+      $project = array();
+      $project["repositories"] = array();
+      $project["developers"] = array();
+      $project["nid"] = $row["nid"];
+    }
+    foreach ($row as $field) {
+      if ($options["field_output"] == "normal") {
+        if ($field->label) {
+          $label = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+        }
+        else {
+          $label = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+        }
+        if (!$field->is_multiple) {
+          $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+        }
+        else {
+          $content = array();
+          foreach($field->content as $n=>$oc) {
+            $content[$n] = $plaintext_output ?
+              check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+          }
+          $content = implode(" ", $content);
+        }
+      }
+      elseif ($options["field_output"] == "raw") {
+        $label = $plaintext_output ?
+          check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+        if (!$field->is_multiple) {
+          $content = $plaintext_output ?
+            check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+        }
+        else {
+          $content = array();
+          foreach($field->raw as $n=>$oc) {
+            $content[$n] = $plaintext_output ?
+              check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+          }
+          $content = implode(" ", $content);
+        }
+      }
+      if (stripos($label, 'homepage') !== FALSE) {
+        $project["homepage"] = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        continue;
+      }
+      if (stripos($label, 'title') !== FALSE) {
+        $project["name"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'shortdesc') !== FALSE) {
+        $project["shortdesc"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'language') !== FALSE) {
+        $project["language"] = check_plain($content);
+        continue;
+      }
+      if (stripos($label, 'license') !== FALSE) {
+        $project["license"] = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        continue;
+      }
+      if (stripos($label, 'repository') !== FALSE) {
+        $repo = _views_rdf_strip_illegal_xml_attribute_value_chars($content);
+        if (!in_array($repo, $project["repositories"])) {
+          $project["repositories"][] = $repo;
+        }
+        continue;
+      }
+      if (stripos($label, 'authors') !== FALSE) {
+        $dev = check_plain($content);
+        if (!in_array($dev, $project["developers"])) {
+          $project["developers"][] = $dev;
+        }
+        continue;
+      }
+    }
+    $projects[$project["nid"]] = $project;
+  }//for
+  $vars["projects"] = $projects;
+ }
diff -rupN ./views_datasource/theme/views-views-xhtml-style-hcalendar.tpl.php ./views_datasource_d7/theme/views-views-xhtml-style-hcalendar.tpl.php
--- ./views_datasource/theme/views-views-xhtml-style-hcalendar.tpl.php	2010-06-06 20:27:07.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-xhtml-style-hcalendar.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -88,7 +88,7 @@
     print $xhtml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xhtml;
     exit;
   }  
diff -rupN ./views_datasource/theme/views-views-xhtml-style-hcalendar.tpl.php~ ./views_datasource_d7/theme/views-views-xhtml-style-hcalendar.tpl.php~
--- ./views_datasource/theme/views-views-xhtml-style-hcalendar.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-xhtml-style-hcalendar.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,94 @@
+<?php
+// $Id: views-views-xhtml-style-hcalendar.tpl.php,v 1.1.2.3 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-xhtml-style-hcalendar.tpl.php
+ * Default template for the Views XHTML style plugin using the hCalendar format
+ *
+ * Variables:
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields
+ * - $hcalendar Array of hcalendar arrays as created by template_preprocess_views_views_xhtml_style_hcalendar 
+ *
+ * @ingroup views_templates
+ */
+  //_views_xml_debug_stop($hcalendars);
+  $xhtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
+  $xhtml .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"'.">\r\n";
+  $xhtml .= '<head>'."\r\n";
+  if (!$header) { //build our own header
+	  $xhtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
+	  $xhtml .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"'.">\r\n";
+	  $xhtml .= '<head>'."\r\n";
+	  $xhtml .= "<meta http-equiv=\"Content-Type\" content=$content_type; charset=utf-8/>\r\n";
+	  $xhtml .= '  <meta name="KEYWORDS" content="hCalendars" />'."\r\n";
+	  $xhtml .= '  <title>hCalendars</title>'."\r\n";
+	  $xhtml .= '</head>'."\r\n";
+	  $xhtml .= '<body>'."\r\n";
+    }
+  else {  
+    $xhtml .= "  $header\n";
+  }  
+  $xhtml .= '</head>'."\r\n";
+  $xhtml .= '<body>'."\r\n";
+  foreach($hcalendars as $hcalendar) {
+      $xhtml .= '<div class = "vevent">'."\r\n";
+    $class = $hcalendar['class'];
+    if ($class) $xhtml .= '  <span class="class">'. $class .'</span>'."<br/>\r\n";
+    $categories = $hcalendar['category'];
+    if ($categories)
+      foreach ($categories as $category) $xhtml .= '  <span class="category">'. $category .'</span>'."<br/>\r\n";
+    $dtstart = $hcalendar['dtstart'];
+    if ($dtstart)
+    $xhtml .= '  <span class="dtstart">'. $dtstart .'</span>'."<br/>\r\n";
+    $summary = $hcalendar['summary'];
+    if ($summary) $xhtml .= '  <span class="summary">'. $summary .'</span>'."<br/>\r\n";
+    $dtend = $hcalendar['dtend'];
+    if ($dtend) $xhtml .= '  <span class="dtend">'. $dtend .'</span>'."<br/>\r\n";
+    $location = $hcalendar['location'];
+    if ($location) $xhtml .= '  <span class="location">'. $location .'</span>'."<br/>\r\n";
+    $geo = $hcalendar["geo"];
+    if ($geo) {	
+      $latitude = $geo["latitude"];
+      $longitude = $geo['longitude'];
+      if ($latitude || $longitude) {
+        $xhtml .= "  <div class=\"geo\">\n";
+        if ($location) $xhtml  .= "    $location: \n";
+        if ($latitude) $xhtml  .= "    <span class=\"latitude\">$latitude</span>\n";
+        if ($longitude) $xhtml .= "    <span class=\"longitude\">$longitude</span>\n";
+        $xhtml .= "  </div>\n";
+      }
+    }
+    $status = $hcalendar['status'];
+    if ($status) $xhtml .= '  <span class="status">'. $status .'</span>'."<br/>\r\n";
+    $duration = $hcalendar['duration'];
+    if ($duration) $xhtml .= '  <span class="duration">'. $duration .'</span>'."<br/>\r\n";
+    $uid= $hcalendar['uid'];
+    if ($uid) $xhtml .= '  <span class="uid">'. $uid .'</span>'."<br/>\r\n";
+    $url = $hcalendar['url'];
+    if ($url) $xhtml .= '  <span class="url">'. $url .'</span>'."<br/>\r\n";
+    $last_modified = $hcalendar['last-modified'];
+    if ($last_modified) $xhtml .= '  <span class="last-modified">'. $last_modified .'</span>'."<br/>\r\n";
+    $description = $hcalendar['description'];
+    if ($description) $xhtml .= '  <span class="description">'. $description .'</span>'."<br/>\r\n";
+    $adr = $hcalendar['adr'];
+    if ($adr) {
+      $xhtml .= "  <div class=\"adr\">\n";
+      $adr_type = $adr['address-type'];
+      if ($adr_type) $xhtml .= '    <span class="address-type">'. $adr_type .'</span>'."<br/>\r\n";
+      $xhtml .= "  </div>";
+    }
+    $xhtml .= '</div>'."\r\n";
+  }
+  $xhtml .= '</body>'."\r\n";
+  $xhtml .= '</html>'."\r\n";	
+  if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xhtml);
+  }
+  else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xhtml;
+  }
+  else {
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xhtml;
+    exit;
+  }  
diff -rupN ./views_datasource/theme/views-views-xhtml-style-hcard.tpl.php ./views_datasource_d7/theme/views-views-xhtml-style-hcard.tpl.php
--- ./views_datasource/theme/views-views-xhtml-style-hcard.tpl.php	2010-06-06 20:27:07.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-xhtml-style-hcard.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -122,7 +122,7 @@
     print $xhtml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xhtml;
     exit;
   }  
diff -rupN ./views_datasource/theme/views-views-xhtml-style-hcard.tpl.php~ ./views_datasource_d7/theme/views-views-xhtml-style-hcard.tpl.php~
--- ./views_datasource/theme/views-views-xhtml-style-hcard.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-xhtml-style-hcard.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,128 @@
+<?php
+// $Id: views-views-xhtml-style-hcard.tpl.php,v 1.1.2.3 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-xhtml-style-hcard.tpl.php
+ * Default template for the Views XHTML style plugin using the hCard format
+ *
+ * Variables:
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields
+ * - $hcards Array of hcard arrays as created by template_preprocess_views_views_xhtml_style_hcard 
+ *
+ * @ingroup views_templates
+ */
+  
+  $xhtml .= '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">'."\n";
+  $xhtml .= '<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr"'.">\r\n";
+  $xhtml .= '<head>'."\r\n";
+  if (!$header) { //build our own header
+    $xhtml .= '  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />'."\r\n";
+    $xhtml .= '  <meta name="KEYWORDS" content="hCards" />'."\r\n";
+    $xhtml .= '  <title>hCards</title>'."\r\n";     
+    $xhtml .= "<meta http-equiv=\"Content-Type\" content=$content_type; charset=utf-8/>\r\n";
+    $xhtml .= '  <meta name="KEYWORDS" content="hCards" />'."\r\n";
+    $xhtml .= '  <title>hCards</title>'."\r\n";
+    }
+  else {  
+    $xhtml .= "  $header\n";
+  }  
+  $xhtml .= '</head>'."\r\n";
+  $xhtml .= '<body>'."\r\n";
+  foreach($hcards as $hcard) {
+    $xhtml .= '<div class = "vcard">'."\r\n";
+    if ($hcard['photo'] != '')
+      $xhtml .= '  <img class="photo" alt="photo" title="photo" style="height:96px;width:96px" src="'. $hcard['photo'] .'"/>'."<br/>\r\n";
+    if ($hcard['fn'])
+      $xhtml .= '  <span class="fn">'. $hcard['fn'] .'</span>'."<br/>\r\n";
+    if ($hcard['nickname'])
+      $xhtml .= '  <span class="nickname">'. $hcard['nickname'] .'</span>'."<br/>\r\n";
+    $name = $hcard['n'];
+    if ($hcard['fn'])
+      $xhtml .= '  <span class = "n">'."\r\n";
+    else
+      $xhtml .= '  <span class = "fn n">'."\r\n";
+    if ($name['honorific-prefix'] !== '')
+      $xhtml .= '    <span class="honorific-prefix">'. $name['honorific-prefix'] .'</span>'."\r\n";
+    if ($name['given-name'] !== '')
+      $xhtml .= '    <span class="given-name">'. $name['given-name'] .'</span>'."\r\n";
+    if ($name['additional-name'] !== '')
+      $xhtml .= '    <span class="additional-name">'. $name['additional-name'] .'</span>'."\r\n";
+    if ($name['family-name'] !== '')
+      $xhtml .= '    <span class="family-name">'. $name['family-name'] .'</span>'."\r\n";
+    if ($name['honorific-suffix'] !== '')
+      $xhtml .= '    <span class="honorific-suffix">'. $name['honorific-suffix'] .'</span>'."\r\n";
+    $xhtml .= '  </span><br/>'."\r\n";
+    if ($hcard['nickname'] !== '')
+      $xhtml .= '    <span class="nickname">'. $hcard['nickname'] .'</span><br/>'."\r\n";
+    $org = $hcard['org'];
+    $xhtml .= '  <span class="org">'."\r\n";
+    if ($org['organization-name'] !== '')
+      $xhtml .= '    <span class="organization name">'. $org['organization-name'] .'</span><br/>'."\r\n";
+    $org_units = $org['organization-unit'];
+    foreach ($org_units as $org_unit)
+      $xhtml .= '    <span class="organization-unit">'. $org_unit .'</span>'."<br/>\r\n";
+    $xhtml .= '  </span>'."\r\n";
+    $address = $hcard['adr'];
+    $xhtml .= '  <span class = "adr">'."\r\n";
+    if ($address['type'] !== '')
+      $xhtml .= '    <span class="type">'. $address['type'] .'</span>'."<br/>\r\n";
+    if ($address['post-office-box'] !== '')
+      $xhtml .= '    <span class="post-office-box">'. $address['post-office-box'] .'</span>'."<br/>\r\n";
+    $street_addresses = $address['street-address'];
+    foreach ($street_addresses as $street_address)
+      $xhtml .= '    <span class="street-address">'. $street_address .'</span>'."<br/>\r\n";
+    if ($address['extended-address'] !== '')
+      $xhtml .= '    <span class="extended-address">'. $address['extended-address'] .'</span>'."<br/>\r\n";
+    if ($address['region'] !== '')
+      $xhtml .= '    <span class="region">'. $address['region'] .'</span>'."<br/>\r\n";
+    if ($address['locality'] !== '')
+      $xhtml .= '    <span class="locality">'. $address['locality'] .'</span>'."<br/>\r\n";
+    if ($address['postal-code'] !== '')
+      $xhtml .= '    <span class="postal-code">'. $address['postal-code'] .'</span>'."<br/>\r\n";
+    if ($address['country-name'] !== '')
+      $xhtml .= '    <span class="country-name">'. $address['country-name'] .'</span>'."\r\n";
+    $xhtml .= '  </span><br/>'."\r\n";
+    $agents = $hcard['agent'];
+    foreach ($agents as $agent)
+      $xhtml .= '  <span class="agent">'. $agent .'</span>'."<br/>\r\n";
+    $birthday =  $hcard['bday'];
+    if ($birthday !== '')
+      $xhtml .= '  <span class="bday">'. $birthday .'</span>'."<br/>\r\n";
+    $class = $hcard['class'];
+    if ($class !== '')
+      $xhtml .= '  <span class="class">'. $class .'</span>'."<br/>\r\n";
+    $categories = $hcard['category'];
+    foreach ($categories as $category)
+      $xhtml .= '  <span class="category">'. $category .'</span>'."<br/>\r\n";
+    if ($hcard['email']) {
+      $mail_addrs = $hcard['email'];
+      foreach ($mail_addrs as $mail_type => $mail_addr)
+        $xhtml .= '  <span class="email">'."\r\n".
+                  '    <span class="type">'. $mail_type .': </span>'."\r\n".
+                  '    <a class="value" href="mailto:'. $mail_addr .'">'. $mail_addr .'</a>'."\r\n".
+                  '  </span>'."<br/>\r\n";
+
+    }
+    if ($hcard['tel']) {
+      $tel_nos = $hcard['tel'];
+      foreach ($tel_nos as $tel_no_type => $tel_no)
+        $xhtml .= '  <span class="tel">'.
+                    '<span class="type">'. $tel_no_type .': </span>'.
+                    '<span class="value">'. $tel_no .'</span>'.
+                    '</span>'."<br/>\r\n";
+    }
+    $xhtml .= '</div>'."\r\n";
+  }
+  $xhtml .= '</body>'."\r\n";
+  $xhtml .= '</html>'."\r\n";	
+  if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xhtml);
+  }
+  else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xhtml;
+  }
+  else {
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xhtml;
+    exit;
+  }  
diff -rupN ./views_datasource/theme/views_views_xhtml_style.theme.inc ./views_datasource_d7/theme/views_views_xhtml_style.theme.inc
--- ./views_datasource/theme/views_views_xhtml_style.theme.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/theme/views_views_xhtml_style.theme.inc	2011-02-24 22:36:58.000000000 -0800
@@ -14,7 +14,7 @@
  * @see views_xhtml.views.inc
  */
 
-function template_preprocess_views_views_xhtml_style_hcard($vars) {
+function template_preprocess_views_views_xhtml_style_hcard(&$vars) {
 	global $user;
 	global $base_url; 
   $view = $vars["view"];
@@ -176,7 +176,7 @@ function template_preprocess_views_views
   $vars["hcards"] = $hcards;  
 }
 
-function template_preprocess_views_views_xhtml_style_hcalendar($vars) {
+function template_preprocess_views_views_xhtml_style_hcalendar(&$vars) {
 	global $user;
 	global $base_url; 
   $view = $vars["view"];
diff -rupN ./views_datasource/theme/views_views_xhtml_style.theme.inc~ ./views_datasource_d7/theme/views_views_xhtml_style.theme.inc~
--- ./views_datasource/theme/views_views_xhtml_style.theme.inc~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views_views_xhtml_style.theme.inc~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,314 @@
+<?php
+// $Id: views_views_xhtml_style.theme.inc,v 1.1.2.4 2010/07/15 07:34:48 allisterbeharry Exp $
+
+/**
+ * @file
+ * View template to render view fields as xhtml.
+ *
+ * - $view: The view in use.
+ * - $rows: Array of row objects as rendered by _views_json_render_fields 
+ * - $attachment: not used currently
+ * - $options: The options for the style passed in from the UI.
+ *
+ * @ingroup views_templates
+ * @see views_xhtml.views.inc
+ */
+
+function template_preprocess_views_views_xhtml_style_hcard($vars) {
+	global $user;
+	global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+	$base = $view->base_table;
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'text/html' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+  	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+  	$vars["id"] = check_url($view->get_url());
+  	$vars["author"] = _views_xhtml_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  } else $vars["header"] = $header;
+	$hcards = array();
+  foreach($rows as $row) {
+    $hcard = array(
+      'adr' => array(
+        'type' => '',
+        'post-office-box' => '',
+        'street-address' => array(),
+        'extended-address' => '',
+        'region' => '',
+        'locality' => '',
+        'postal-code' => '',
+        'country-name' => '',
+      ),
+      'agent' => array(),
+      'bday' => '',
+      'class' => '',
+      'category' => array(),
+      'email' => array(),
+      'fn' => '',
+      'n' => array(
+        'honorific-prefix' => '',
+        'given-name' => '',
+        'additional-name' => '',
+        'family-name' => '',
+        'honorific-suffix' => '',
+      ),
+      'nickname' => '',
+      'org' => array(
+        'organization-name' => '',
+        'organization-unit' => array(),
+      ),
+      'photo' => '',
+      'tel' => array(),
+    );
+  	foreach ($row as $field) {
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	else  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	  	if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+		    else {		    	
+		    	$content = array();
+		    	foreach($field->content as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    	$content = implode(" ", $content);
+		    }  	  	    	  	    	  	
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	    if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+		    else { 
+		      $content = array();
+		      foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		      $content = implode(" ", $content);
+		    }  	  	  	    	  	
+  	  }
+  	  $label = _views_xml_strip_illegal_xml_name_chars(html_entity_decode(check_plain(strip_tags($label))));
+  	  $content = (($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": $content);
+  	  //if (($options["skip_empty_fields"] == TRUE) && (is_null($content) || $content === "")) continue;
+  	  if ((stripos($label, 'address_type') !== FALSE) || (stripos($label, 'addresstype') !== FALSE)) {
+        $hcard['adr']['type'] = $content;
+      }
+      if ((stripos($label, 'post_office_box') !== FALSE) || (stripos($label, 'postofficebox') !== FALSE)) {
+        $hcard['adr']['post-office-box'] = $content;
+      }
+      if ((stripos($label, 'street_address') !== FALSE) || (stripos($label, 'strestaddress') !== FALSE)) {
+        $hcard['adr']['street-address'][] = $content;
+      }
+      if ((stripos($label, 'extended_address') !== FALSE) || (stripos($label, 'extendedaddress') !== FALSE)) {
+        $hcard['adr']['extended-address'] = $content;
+      }
+      if (stripos($label, 'region') !== FALSE) {
+        $hcard['adr']['region'] = $content;
+      }
+      if (stripos($label, 'locality') !== FALSE) {
+        $hcard['adr']['locality'] = $content;
+      }
+      if ((stripos($label, 'postal_code') !== FALSE) || (stripos($label, 'postalcode') !== FALSE)) {
+        $hcard['adr']['postal-code'] = $content;
+      }
+      if ((stripos($label, 'country_name') !== FALSE) || (stripos($label, 'countryname') !== FALSE)) {
+        $hcard['adr']['country-name'] = $content;
+      }
+      if (stripos($label, 'agent') !== FALSE) {
+        $hcard['agent'][] = $content;
+      }
+      if (stripos($label, 'bday') !== FALSE) {
+//        if (preg_match('/\d/', $content)) {
+//          if (strtotime($content))
+//            $value = format_date(strtotime($value), 'custom', EXHIBIT_DATE_FORMAT);
+//        }
+        $hcard['bday'] = $content;
+      }
+      if (stripos($label, 'class') !== FALSE) {
+        $hcard['class'] = $content;
+      }
+      if (stripos($label, 'category') !== FALSE) {
+        $hcard['category'][] = $content;
+      }
+      if (stripos($label, 'email') !== FALSE) {
+        $hcard['email'][$label] = $content;
+      }
+      if ((stripos($label, 'honorific_prefix') !== FALSE) || (stripos($label, 'honorificprefix') !== FALSE)) {
+        $hcard['n']['honorific-prefix'] = $content;
+      }
+      if ((stripos($label, 'given_name') !== FALSE) || (stripos($label, 'given name') !== FALSE)) {
+        $hcard['n']['given-name'] = $content;
+      }
+      if ((stripos($label, 'additional_name') !== FALSE) || (stripos($label, 'additionalname') !== FALSE)) {
+        $hcard['n']['additional-name'] = $content;
+      }
+      if ((stripos($label, 'family_name') !== FALSE) || (stripos($label, 'familyname') !== FALSE)) {
+        $hcard['n']['family-name'] = $content;
+      }
+      if ((stripos($label, 'honorific_suffix') !== FALSE) || (stripos($label, 'honorificsuffix') !== FALSE)) {
+        $hcard['n']['honorific-suffix'] = $content;
+      }
+      if (stripos($label, 'fn') !== FALSE) {
+        $hcard['fn'] = $content;
+      }
+      if (stripos($label, 'nickname') !== FALSE) {
+        $hcard['nickname'] = $content;
+      }
+      if ((stripos($label, 'organization_name') !== FALSE) || (stripos($label, 'organizationname') !== FALSE)) {
+        $hcard['org']['organization-name'] = $content;
+      }
+      if ((stripos($label, 'organization_unit') !== FALSE) || (stripos($label, 'organizationunit') !== FALSE)) {
+        $hcard['org']['organization-unit'][] = $content;
+      }
+      if (stripos($label, 'photo') !== FALSE) {
+        $hcard['photo'] = $content;
+      }
+      if (stripos($label, 'tel') === 0) {
+        $hcard['tel'][$label] = $content;
+      }	
+  	} $hcards[] = $hcard;
+  }//for
+  $vars["hcards"] = $hcards;  
+}
+
+function template_preprocess_views_views_xhtml_style_hcalendar($vars) {
+	global $user;
+	global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+	$base = $view->base_table;
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'text/html' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$vars["header"]) {
+  	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+  	$vars["id"] = check_url($view->get_url());
+  	$vars["author"] = _views_xhtml_format_author($options["author"]);
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  } else $vars["header"] = $header;
+	$hcalendars = array();
+  foreach($rows as $row) {
+  	//_views_rdf_debug_stop($row);
+  	$hcalendar = array();
+  	foreach ($row as $field) {
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	else  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	    if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+		    else {		    	
+		    	$content = array();
+		    	foreach($field->content as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    	$content = implode(" ", $content);
+		    }  	  	    	  	    	  	
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	    if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+		    else { 
+		      $content = array();
+		      foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		      $content = implode(" ", $content);
+		    }  	  	  	    	  	  	  	
+  	  }
+  	  $label = _views_xml_strip_illegal_xml_name_chars(html_entity_decode(check_plain(strip_tags($label))));
+  	  $content = (($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": $content);  	
+      if (stripos($label, 'class') !== FALSE) {
+        $hcalendar['class'] = $content;
+      }
+      if (stripos($label, 'category') !== FALSE) {
+        $hcalendar['category'][] = $content;
+      }
+      if (stripos($label, 'description') !== FALSE) {
+        $hcalendar['description'] = $content;
+      }
+      if (stripos($label, 'summary') !== FALSE) {
+        $hcalendar['summary'] = $content;
+      }
+      if ((stripos($label, 'dtstart') !== FALSE) || (stripos($label, 'event_start') !== FALSE) || (stripos($label, 'eventstart') !== FALSE)
+         || (stripos($label, 'start'))) {
+//        if (preg_match('/\d/', $content)) {
+//          if (strtotime($content))
+//            $content = format_date(strtotime($content), 'custom', EXHIBIT_DATE_FORMAT);
+//        }
+        $hcalendar['dtstart'] = $content;
+      }
+      if ((stripos($label, 'dtend') !== FALSE) || (stripos($label, 'event_end') !== FALSE) || (stripos($label, 'eventendtime') !== FALSE)
+      || (stripos($label, 'eventend') !== FALSE)|| (stripos($label, 'end') !== FALSE)) {
+//        if (preg_match('/\d/', $content)) {
+//          if (strtotime($content))
+//            $content = format_date(strtotime($content), 'custom', EXHIBIT_DATE_FORMAT);
+//        }
+        $hcalendar['dtend'] = $content;
+      }
+      if (stripos($label, 'duration') !== FALSE) {
+        $hcalendar['duration'] = $content;
+      }
+      if ((stripos($label, 'geo_latitude') !== FALSE) || (stripos($label, 'geolatitude') !== FALSE)) {
+        $hcalendar['geo']['latitude'] = $content;
+      }
+      if ((stripos($label, 'geo_longitude') !== FALSE) || (stripos($label, 'geolongitude') !== FALSE)) {
+        $hcalendar['geo']['longitude'] = $content;
+      }
+      if (stripos($label, 'location') !== FALSE) {
+        $hcalendar['location'] = $content;
+      }
+      if (stripos($label, 'status') !== FALSE) {
+        $hcalendar['status'] = $content;
+      }
+      if (stripos($label, 'uid') !== FALSE) {
+        $hcalendar['uid'] = $content;
+      }
+      if (stripos($label, 'url') !== FALSE) {
+        $hcalendar['url'] = $content;
+      }
+      if ((stripos($label, 'last_modified') !== FALSE) || (stripos($label, 'lastmodified') !== FALSE)) {
+//        if (preg_match('/\d/', $content)) {
+//          if (strtotime($content))
+//            $content = format_date(strtotime($content), 'custom', EXHIBIT_DATE_FORMAT);
+//        }
+        $hcalendar['last-modified'] = $content;
+      }
+      if ((stripos($label, 'address_type') !== FALSE) || (stripos($label, 'addresstype') !== FALSE)) {
+        $hcalendar['adr']['type'] = $content;
+      }
+      if ((stripos($label, 'post_office_box') !== FALSE) || (stripos($label, 'postofficebox') !== FALSE)) {
+        $hcalendar['adr']['post-office-box'] = $content;
+      }
+      if ((stripos($label, 'street_address') !== FALSE) || (stripos($label, 'streetaddress') !== FALSE)) {
+        $hcalendar['adr']['street-address'][] = $content;
+      }
+      if ((stripos($label, 'extended_address') !== FALSE) || (stripos($label, 'extended address') !== FALSE)) {
+        $hcalendar['adr']['extended-address'] = $content;
+      }
+      if (stripos($label, 'region') !== FALSE) {
+        $hcalendar['adr']['region'] = $content;
+      }
+      if (stripos($label, 'locality') !== FALSE) {
+        $hcalendar['adr']['locality'] = $content;
+      }
+      if ((stripos($label, 'postal_code') !== FALSE) || (stripos($label, 'postalcode') !== FALSE)) {
+        $hcalendar['adr']['postal-code'] = $content;
+      }
+      if (stripos($label, 'country_name') !== FALSE) {
+        $hcalendar['adr']['country-name'] = $content;
+      }  	
+  	} 
+  	$hcalendars[] = $hcalendar;
+  }//for
+  $vars["hcalendars"] = $hcalendars;  
+}
+
diff -rupN ./views_datasource/theme/views-views-xml-style-atom.tpl.php ./views_datasource_d7/theme/views-views-xml-style-atom.tpl.php
--- ./views_datasource/theme/views-views-xml-style-atom.tpl.php	2010-07-15 15:53:41.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-xml-style-atom.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -13,11 +13,12 @@
  */
 
 global $base_url;
+$xml = "";
 $content_type = ($options['content_type'] == 'default') ? 'application/atom+xml' : $options['content_type'];
 $xml .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
 $xml .= "<!-- generator=\"Drupal Views Datasource.Module\" -->\n";
 $xml .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en\">\n";
-if (!$header) { //build our own header
+if (empty($header) || !$header) { //build our own header
 	$xml .= "  <title>$title</title>\n";
 	$xml .= "  <link rel=\"alternate\" type=\"text/html\" href=\"$base_url\" />\n";
 	$xml .= "  <link rel =\"self\" type=\"application/atom+xml\" href=\"$link\" />\n";
@@ -51,9 +52,9 @@ foreach($entries as $entry) {
     if (array_key_exists("teaser", $entry)) $teaser = $entry["teaser"];
     if (array_key_exists("content", $entry)) $content = $entry["content"];
     $xml .= "  <entry>\n    <id>$id</id>\n    <title>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$title]]>": "$title")."</title>\n    <updated>$updated</updated>\n";  //put required elements first
-    if ($link) $xml .= "    <link href=\"$link\"/>\n";
-    if ($teaser) $xml .= "    <teaser>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$teaser]]>": "$teaser")."</teaser>\n";
-    if ($content) $xml .= "    <content>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": "$content")."</content>\n";
+    if (isset($link)) $xml .= "    <link href=\"$link\"/>\n";
+    if (isset($teaser)) $xml .= "    <teaser>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$teaser]]>": "$teaser")."</teaser>\n";
+    if (isset($content)) $xml .= "    <content>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": "$content")."</content>\n";
     if (array_key_exists("author", $entry)) {
     	$author_name = $entry["author"]["name"]; if (array_key_exists("email", $entry["author"])) $author_email = $entry["author"]["email"];
     	$xml .= "    <author>\n      <name>$author_name</name>\n";      
@@ -80,7 +81,7 @@ foreach($entries as $entry) {
     print $xml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xml;
     exit;
-  }
\ No newline at end of file
+  }
diff -rupN ./views_datasource/theme/views-views-xml-style-atom.tpl.php~ ./views_datasource_d7/theme/views-views-xml-style-atom.tpl.php~
--- ./views_datasource/theme/views-views-xml-style-atom.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-xml-style-atom.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,86 @@
+<?php
+// $Id: views-views-xml-style-atom.tpl.php,v 1.1.2.5 2010/07/15 22:53:41 allisterbeharry Exp $
+/**
+ * @file views-views-xml-style-atom.tpl.php
+ * Default template for the Views XML style plugin using the Atom schema
+ *
+ * Variables
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields
+ * - $entries Array of Atom entries as created by template_preprocess_views_views_xml_style_atom 
+ *
+ * @ingroup views_templates
+ */
+
+global $base_url;
+$content_type = ($options['content_type'] == 'default') ? 'application/atom+xml' : $options['content_type'];
+$xml .= "<?xml version=\"1.0\" encoding=\"UTF-8\" ?>\n";
+$xml .= "<!-- generator=\"Drupal Views Datasource.Module\" -->\n";
+$xml .= "<feed xmlns=\"http://www.w3.org/2005/Atom\" xml:lang=\"en\">\n";
+if (!$header) { //build our own header
+	$xml .= "  <title>$title</title>\n";
+	$xml .= "  <link rel=\"alternate\" type=\"text/html\" href=\"$base_url\" />\n";
+	$xml .= "  <link rel =\"self\" type=\"application/atom+xml\" href=\"$link\" />\n";
+	$xml .= "  <id>tag:$link</id> \n";
+	$xml .= "  <updated>$updated</updated>\n";
+	if ($author) {
+		$xml .= "  <author>\n";
+		$xml .= "    <name>".$author["name"]."</name>\n"; 
+		if (array_key_exists("email", $author))
+		  $xml .= "    <email>".$author["email"]."</email>\n";
+	  $xml .= "  </author>\n";
+	}        
+}
+else {  
+  $xml .= "  $header\n";
+}
+
+foreach($entries as $entry) {
+	//_views_xml_debug_stop($entry);
+    if (!((array_key_exists("id", $entry)) && array_key_exists("title", $entry) && array_key_exists("updated", $entry))) {
+      if ($view->override_path)
+        print '<b style="color:red">Either the id, title, or updated attribute is missing.</b>';
+      elseif ($options['using_views_api_mode'])
+        print "Either the id, title, or updated attribute is missing.";   
+      else drupal_set_message(t('Either the id, title, or updated attribute is missing.'), 'error');
+      return;
+    }
+    $id = $entry["id"];  $title = $entry["title"]; $updated = $entry["updated"]; 
+     
+    if (array_key_exists("link", $entry)) $link = $entry["link"];
+    if (array_key_exists("teaser", $entry)) $teaser = $entry["teaser"];
+    if (array_key_exists("content", $entry)) $content = $entry["content"];
+    $xml .= "  <entry>\n    <id>$id</id>\n    <title>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$title]]>": "$title")."</title>\n    <updated>$updated</updated>\n";  //put required elements first
+    if ($link) $xml .= "    <link href=\"$link\"/>\n";
+    if ($teaser) $xml .= "    <teaser>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$teaser]]>": "$teaser")."</teaser>\n";
+    if ($content) $xml .= "    <content>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": "$content")."</content>\n";
+    if (array_key_exists("author", $entry)) {
+    	$author_name = $entry["author"]["name"]; if (array_key_exists("email", $entry["author"])) $author_email = $entry["author"]["email"];
+    	$xml .= "    <author>\n      <name>$author_name</name>\n";      
+    	if ($author_email) $xml .= "      <email>$author_email</email>\n";
+    	$xml .= "    </author>\n";
+    }
+    foreach($entry as $l => $v) { //Then the rest
+    	if (($l != "id") && ($l != "title") && ($l != "updated") && ($l != "author") && ($l != "link") && ($l != "teaser") && ($l != "content")) {
+    	  if (is_array($v)) {
+    	    foreach($v as $i => $j) {
+    	        $xml .= "    <$l>\n".(($options['escape_as_CDATA'] == 'yes') ? "          <![CDATA[$j]]>\n": "      $j")."\n    </$l>\n"; 	
+    	    }	
+    	  }
+    	  else 	$xml .= "    <$l>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$v]]>": "$v")."</$l>\n";
+    	}
+    }
+    $xml .= "  </entry>\n";
+  }
+  $xml .= "</feed>\n";
+  if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xml);
+  }
+  else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xml;
+  }
+  else {
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xml;
+    exit;
+  }
\ No newline at end of file
diff -rupN ./views_datasource/theme/views-views-xml-style-opml.tpl.php ./views_datasource_d7/theme/views-views-xml-style-opml.tpl.php
--- ./views_datasource/theme/views-views-xml-style-opml.tpl.php	2010-06-06 20:27:07.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-xml-style-opml.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -1,4 +1,5 @@
 <?php
+$xml="";
 // $Id: views-views-xml-style-opml.tpl.php,v 1.1.2.4 2010/06/07 03:27:07 allisterbeharry Exp $
 /**
  * @file views-views-xml-style-opml.tpl.php
@@ -15,7 +16,7 @@
   $xml =  "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
   $xml .= '<!-- generator="Drupal Views Datasource.Module" -->'."\n";
   $xml .= "<opml version =\"2.0\">\n"; 
-  if (!$header) { //build our own header
+if (empty($header) || !$header) { //build our own header
     $xml .= "  <head>\n";
   	$xml .= "    <title>$title</title>\n";
     $xml .= "    <ownerName>$ownerName</ownerName>\n";
@@ -59,8 +60,8 @@
   }
   else {
     $content_type = $options["content_type"];
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xml;
     exit;
   }
- 
\ No newline at end of file
+ 
diff -rupN ./views_datasource/theme/views-views-xml-style-opml.tpl.php~ ./views_datasource_d7/theme/views-views-xml-style-opml.tpl.php~
--- ./views_datasource/theme/views-views-xml-style-opml.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-xml-style-opml.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,66 @@
+<?php
+// $Id: views-views-xml-style-opml.tpl.php,v 1.1.2.4 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-xml-style-opml.tpl.php
+ * Default template for the Views XML style plugin using the OPML schema
+ *
+ * Variables:
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields
+ * - $outlines Array of outline arrays as created by template_preprocess_views_views_xml_style_opml 
+ *
+ * @ingroup views_templates
+ */
+  //_views_xml_debug_stop($outlines);
+  $xml =  "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
+  $xml .= '<!-- generator="Drupal Views Datasource.Module" -->'."\n";
+  $xml .= "<opml version =\"2.0\">\n"; 
+  if (!$header) { //build our own header
+    $xml .= "  <head>\n";
+  	$xml .= "    <title>$title</title>\n";
+    $xml .= "    <ownerName>$ownerName</ownerName>\n";
+    $xml .= "    <ownerEmail>$ownerEmail</ownerEmail>\n";
+    $xml .= "    <docs>$docs</docs>\n";
+    $xml .= "    <dateCreated>$dateCreated</dateCreated>\n";
+    $xml .= "  </head>\n";
+  } 
+  else {
+    $xml .= "  <head>\n  
+                 $header\n
+               </head>\n";
+  }
+  $xml .="    <body>\n";
+  foreach($outlines as $outline) {		  
+    if (!array_key_exists("text", $outline)) {
+      if ($view->override_path)
+        print '<b style="color:red">The text field of an outline must be present in an OPML document.</b>';
+      elseif ($options['using_views_api_mode'])
+        print "The text field of an outline must be present in an OPML document.";   
+      else drupal_set_message(t('The text field of an outline must be present in an OPML document.'), 'error');
+      return;
+    }
+    $xml .= "      <outline";
+    foreach($outline as $n => $v) {
+    	if (is_array($v)) {
+    		foreach ($v as $i => $j) $xml .= " $n$i = \"$j\"";
+    	}
+    	//_views_xml_debug_stop($outline);
+    	else $xml .= " $n = \"$v\"";
+    }
+    $xml .= "/>\n";
+  }   	
+  $xml .= '    </body>'."\n";
+  $xml .= '</opml>'."\n";
+  if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xml);
+  }
+  else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xml;
+  }
+  else {
+    $content_type = $options["content_type"];
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xml;
+    exit;
+  }
+ 
\ No newline at end of file
diff -rupN ./views_datasource/theme/views-views-xml-style-raw.tpl.php ./views_datasource_d7/theme/views-views-xml-style-raw.tpl.php
--- ./views_datasource/theme/views-views-xml-style-raw.tpl.php	2010-06-06 20:27:07.000000000 -0700
+++ ./views_datasource_d7/theme/views-views-xml-style-raw.tpl.php	2011-02-24 22:36:58.000000000 -0800
@@ -11,14 +11,14 @@
  * @ingroup views_templates
  * @see views_views_xml_style.theme.inc
  */	
-	if ($view->override_path) {       // inside live preview
+  if (isset($view->override_path)) {       // inside live preview
     print htmlspecialchars($xml);
   }
   else if ($options['using_views_api_mode']) {     // We're in Views API mode.
     print $xml;
   }
   else {
-  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    drupal_add_http_header("Content-Type", "$content_type; charset=utf-8");
     print $xml;
     exit;
-  }
\ No newline at end of file
+  }
diff -rupN ./views_datasource/theme/views-views-xml-style-raw.tpl.php~ ./views_datasource_d7/theme/views-views-xml-style-raw.tpl.php~
--- ./views_datasource/theme/views-views-xml-style-raw.tpl.php~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views-views-xml-style-raw.tpl.php~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,24 @@
+<?php
+// $Id: views-views-xml-style-raw.tpl.php,v 1.1.2.6 2010/06/07 03:27:07 allisterbeharry Exp $
+/**
+ * @file views-views-xml-style-raw.tpl.php
+ * Default template for the Views XML style plugin using the raw schema
+ *
+ * Variables
+ * - $view: The View object.
+ * - $rows: Array of row objects as rendered by _views_xml_render_fields 
+ *
+ * @ingroup views_templates
+ * @see views_views_xml_style.theme.inc
+ */	
+	if ($view->override_path) {       // inside live preview
+    print htmlspecialchars($xml);
+  }
+  else if ($options['using_views_api_mode']) {     // We're in Views API mode.
+    print $xml;
+  }
+  else {
+  	drupal_set_header("Content-Type: $content_type; charset=utf-8");
+    print $xml;
+    exit;
+  }
\ No newline at end of file
diff -rupN ./views_datasource/theme/views_views_xml_style.theme.inc ./views_datasource_d7/theme/views_views_xml_style.theme.inc
--- ./views_datasource/theme/views_views_xml_style.theme.inc	2010-07-15 15:53:41.000000000 -0700
+++ ./views_datasource_d7/theme/views_views_xml_style.theme.inc	2011-02-24 22:36:58.000000000 -0800
@@ -14,7 +14,7 @@
  * @see views_xml.views.inc
  */
 
-function template_preprocess_views_views_xml_style_raw($vars) {
+function template_preprocess_views_views_xml_style_raw(&$vars) {
 	$view = $vars["view"];
   $rows = $vars["rows"];
   $options = $vars["options"];  
@@ -88,7 +88,7 @@ function template_preprocess_views_views
 	$vars["xml"] = $xml;
 }
 
-function template_preprocess_views_views_xml_style_opml($vars) {
+function template_preprocess_views_views_xml_style_opml(&$vars) {
 	global $user;
 	global $base_url; 
 	$view = $vars["view"];
@@ -101,7 +101,7 @@ function template_preprocess_views_views
   $vars["content_type"] = ($options['content_type'] == 'default') ? 'text/html' : $options['content_type'];
   $header  = $options["header"];
   $author = _views_xml_format_author($options["author"]);
-  if (!$header) {
+  if (empty($header) || !$header) {
   	$vars["title"] = ($view->get_title() ? $view->get_title(): $view->name);
   	$vars["dateCreated"] = format_date(time(), 'custom', DATE_RFC822);
   	$vars["ownerName"] = $author["name"];
@@ -221,7 +221,7 @@ function template_preprocess_views_views
  * @param $vars
  * @return unknown_type
  */
-function template_preprocess_views_views_xml_style_atom($vars) {
+function template_preprocess_views_views_xml_style_atom(&$vars) {
 	global $user;
 	global $base_url; 
   $view = $vars["view"];
diff -rupN ./views_datasource/theme/views_views_xml_style.theme.inc~ ./views_datasource_d7/theme/views_views_xml_style.theme.inc~
--- ./views_datasource/theme/views_views_xml_style.theme.inc~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/theme/views_views_xml_style.theme.inc~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,430 @@
+<?php
+// $Id: views_views_xml_style.theme.inc,v 1.1.2.15 2010/07/15 22:53:41 allisterbeharry Exp $
+
+/**
+ * @file
+ * View template to render view fields as XML.
+ *
+ * - $view: The view in use.
+ * - $rows: Array of row objects as rendered by _views_json_render_fields 
+ * - $attachment: not used currently
+ * - $options: The options for the style passed in from the UI.
+ *
+ * @ingroup views_templates
+ * @see views_xml.views.inc
+ */
+
+function template_preprocess_views_views_xml_style_raw($vars) {
+	$view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];  
+  $base = $view->base_table;
+  $root = $options['root_element'];
+  $endroot = preg_replace("/\s+.*/", "", $root);
+  $top_child_object = $options["top_child_object"];
+  $end_top_child_object = preg_replace("/\s+.*/", "", $top_child_object);    
+  $plaintext_output = $options["plaintext_output"];
+  $content_type = ($options['content_type'] == 'default') ? 'text/xml' : $options['content_type'];
+  $header = $options['header'];
+  $xml =  "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
+  if ($header) $xml.= $header."\n"; 
+	$xml .= "<$root>\n";
+  foreach($rows as $row) {
+		$xml .= ($options['element_output'] == 'nested') ? "  <$top_child_object>\n": "  <$top_child_object\n";
+	  foreach($row as $id => $object) {
+		  if ($options['field_output'] == 'normal')  {
+		    if ($object->label) 
+		      $label = _views_xml_strip_illegal_xml_name_chars(check_plain(html_entity_decode(strip_tags($object->label))));
+		    else  $label = _views_xml_strip_illegal_xml_name_chars(check_plain(html_entity_decode((strip_tags($id)))));
+		    if (!$object->is_multiple) 
+		      $content = ($plaintext_output ? check_plain(html_entity_decode(strip_tags($object->content))) : _views_xml_xmlEntities($object->content));
+		    else {
+		    	$content = array ();		   
+		    	foreach($object->content as $n=>$oc) {
+		    		$content[$n] = ($plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : _views_xml_xmlEntities($oc));		    		
+		    	}
+		    }		    
+		  }
+		  elseif ($options['field_output'] == 'raw') {
+		   $label = _views_xml_strip_illegal_xml_name_chars(check_plain(html_entity_decode(strip_tags($id))));
+		   if (!$object->is_multiple) 
+		      $content = ($plaintext_output ? check_plain(html_entity_decode(strip_tags($object->raw))) : _views_xml_xmlEntities($object->raw));
+		    else {
+		    	foreach($object->raw as $n=>$oc) $content[$n] = ($plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : _views_xml_xmlEntities($oc));
+		    }
+		  }
+		  $endlabel = preg_replace("/\s+.*/", "", $label);
+		  if ($options['element_output'] == 'nested') {		  	
+			  if (!is_array($content)) {
+			  	$xml .= "    <$label>".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$content]]>": $content)."</$endlabel>\n";
+			  	//_views_xml_debug_stop($xml);
+			  }
+			  else {
+			  	foreach ($content as $c) {
+		  	    $xml .= "    <$label>";
+			      $xml .= "".(($options['escape_as_CDATA'] == 'yes') ? "<![CDATA[$c]]>": $c."");
+			      $xml .= "</$endlabel>\n";			  		
+			  	}			  	
+			  }
+		  }
+		  elseif($options['element_output'] == 'attributes') {
+		  	if (!is_array($content)) {
+          $content = _views_xml_strip_illegal_xml_attribute_value_chars($content);
+		      $xml .= " $label=\"$content\" ";
+		  	}
+		  	else {
+			  	foreach ($content as $n=>$c) {
+            $c = _views_xml_strip_illegal_xml_attribute_value_chars($c);
+            $label = _views_xml_strip_illegal_xml_name_chars($label);
+		        $xml .= " $label$n=\"$c\" ";
+			  	}			  			  		
+		  	}
+		  }
+	  }
+
+	  $xml .= ($options['element_output'] == 'nested') ? "  </$end_top_child_object>\n": "/>\n";
+	}
+	$xml .= "</$endroot>\n";
+	$vars["xml"] = $xml;
+}
+
+function template_preprocess_views_views_xml_style_opml($vars) {
+	global $user;
+	global $base_url; 
+	$view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+	$base = $view->base_table;
+	$top_child_object = $options["top_child_object"];
+  $root = "opml";;
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'text/html' : $options['content_type'];
+  $header  = $options["header"];
+  $author = _views_xml_format_author($options["author"]);
+  if (!$header) {
+  	$vars["title"] = ($view->get_title() ? $view->get_title(): $view->name);
+  	$vars["dateCreated"] = format_date(time(), 'custom', DATE_RFC822);
+  	$vars["ownerName"] = $author["name"];
+  	$vars["ownerEmail"] = $author["email"];
+  	$vars["ownerId"] = url("user/".$user->uid, array('absolute' => TRUE));
+  	$vars["docs"] = url($view->get_url(), array('absolute' => TRUE)); //$base_url;
+  } else $vars["header"] = $header;
+	$outlines = array();
+  foreach($rows as $row) {
+  	$outline = array();
+  	foreach ($row as $field) {
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label) 
+  	  	  $label = _views_xml_strip_illegal_xml_name_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label);
+  	  	else $label = _views_xml_strip_illegal_xml_name_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id);
+  	    if (!$field->is_multiple) 
+		      $content = _views_xml_strip_illegal_xml_attribute_value_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content);
+		    else {		    	
+		    	$content = array();
+		    	foreach($field->content as $n=>$oc) $content[$n] = _views_xml_strip_illegal_xml_attribute_value_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc);
+		    }  	  	  
+  	  }
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = _views_xml_strip_illegal_xml_name_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id);  	  	
+  	    if (!$field->is_multiple) 
+		      $content = _views_xml_strip_illegal_xml_attribute_value_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw);
+		    else { 
+		    	$content = array();
+		    	foreach($field->raw as $n=>$oc) $content[$n] = _views_xml_strip_illegal_xml_attribute_value_chars($plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc);
+		    }  	  	
+  	  }
+  	    	  	  
+		  /* OPML text attribute */
+			if (!array_key_exists("text", $outline)) {
+			  if (drupal_strtolower($label) == "text") {
+	  	    $outline["text"] = $content;
+	  	    continue;
+	      }
+	      elseif (drupal_strtolower($label) == "body") {
+	        $outline["text"] = $content;
+	  		  continue;
+	  	  }
+	  	  elseif ((drupal_strtolower($label) == "node_revisions_body")) {
+	  		  $outline["text"] = $content;
+	  		  continue;
+	  	  }
+	  	}
+		  
+	  	/* OPML type attribute */
+	  	if (!array_key_exists("type", $outline)) {
+	  	  if (drupal_strtolower($label) == "type") {
+	  	    $outline["type"] = $content;
+	  	    continue;
+	      }
+	      elseif (drupal_strtolower($label) == "node_type") {
+	        $outline["type"] = $content;
+	  		  continue;
+	  	  }
+	  	}
+	  	
+	  	/* OPML isComment attribute */
+	  	if (!array_key_exists("isComment", $outline)) {
+	      if (drupal_strtolower($label) == "iscomment") {
+	  	    $outline["isComment"] = $content;
+	  	    continue;
+	      }	  		
+	    }
+	    
+			/* OPML isBreakpoint attribute */
+	  	if (!array_key_exists("isBreakpoint", $outline)) {
+	      if (drupal_strtolower($label) == "isbreakpoint") {
+	  	    $outline["isBreakpoint"] = $content;
+	  	    continue;
+	      }	  		
+	    }
+
+	    /* OPML created attribute */
+	  	if (!array_key_exists("created", $outline)) {
+	  		$value = NULL;
+	      if (drupal_strtolower($label) == "created") {
+	      	$value = $content;
+	      }
+	      elseif (drupal_strtolower($label) == "published") {
+	      	$value = $content;
+	      }
+	      elseif (drupal_strtolower($label) == "node_created") {
+	      	$value = $content;
+	      }
+	  		elseif (drupal_strtolower($label) == "postdate") {
+	      	$value = $content;
+	      }
+//	      if ($value) {
+//	        $value = $field->raw;
+//	      	if (intval($value))  // timestamp
+//            $value = format_date(intval($value), 'custom', DATE_RFC822);
+//          elseif (getdate($value))      // string date
+//            $value = format_date(strtotime($value), 'custom', DATE_RFC822);
+//	        //otherwise just pass the string as is
+//          $outline["created"] = $value;
+//	  	    continue;
+//	      }
+	  	   if ($value) $outline["created"] = $value;
+	  	   //continue;	      	      	      
+	  	   
+	  	} 
+      //Otherwise just use the $label and $content as attribute nam and value
+	    $outline[$label] = $content; 	    		
+		}
+    $outlines[] = $outline;
+  }	
+  //_views_xml_debug_stop($outlines);
+  $vars["outlines"] = $outlines;   
+}
+
+/**
+ * Template preprocess for the Atom format
+ * @param $vars
+ * @return unknown_type
+ */
+function template_preprocess_views_views_xml_style_atom($vars) {
+	global $user;
+	global $base_url; 
+  $view = $vars["view"];
+  $rows = $vars["rows"];
+  $options = $vars["options"];
+  $link = $view->display_handler->get_path();
+  $url_options = array('absolute' => TRUE);
+  if (!empty($view->exposed_raw_input)) {
+    $url_options['query'] = $view->exposed_raw_input;
+  }
+	$base = $view->base_table;
+  $root = "feed";
+  $plaintext_output = $options["plaintext_output"];
+  $vars["content_type"] = ($options['content_type'] == 'default') ? 'application/atom+xml' : $options['content_type'];
+  $header  = $options["header"];
+  if (!$header) {
+  	$vars["title"] = check_plain(($view->get_title() ? $view->get_title(): $view->name));
+  	$vars["id"] = check_url($view->get_url());
+  	$vars["updated"] = format_date(time(), 'custom', DATE_ATOM);
+  	if ($options["author"]) $vars["author"] = _views_xml_format_author($options["author"]);  
+    $vars['link'] = check_url(url($view->display_handler->get_path(), $url_options));
+  } else $vars["header"] = $header;
+	$entries = array();
+  foreach($rows as $row) {
+  	$entry = array();
+  	foreach ($row as $field) {
+  	  if ($options["field_output"] == "normal") {
+  	  	if ($field->label)
+  	  	  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->label))) : $field->label;
+  	  	else  $label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	  	if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->content;
+		    else {		    	
+		    	$content = array();
+		    	foreach($field->content as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    }  	  	    	  	
+  	  }  	  
+  	  elseif ($options["field_output"] == "raw") {
+  	  	$label = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->id))) : $field->id;
+  	    if (!$field->is_multiple) 
+		      $content = $plaintext_output ? check_plain(html_entity_decode(strip_tags($field->content))) : $field->raw;
+		    else { 
+		      $content = array();
+		      foreach($field->raw as $n=>$oc) $content[$n] = $plaintext_output ? check_plain(html_entity_decode(strip_tags($oc))) : $oc;
+		    }  	  	  	  
+  	  }
+  	  $label = _views_xml_strip_illegal_xml_name_chars(html_entity_decode(check_plain(strip_tags($label))));  	  
+  	  //if (($options["skip_empty_fields"] == TRUE) && (is_null($content) || $content === "")) continue;
+  	  
+  	  /* Atom id attribute */			
+  	  if (!array_key_exists("id", $entry)) {
+			  if (drupal_strtolower($label) == "id") {
+	  	    $entry["id"] = $content;
+	  	    continue;
+	      }
+	  	}
+
+  	  /* Atom title attribute */			
+  	  if (!array_key_exists("title", $entry)) {
+			  if (drupal_strtolower($label) == "title") {
+	  	    $entry["title"] = $content;
+	  	    continue;
+	      }
+	  	}
+
+	  	/* Atom updated attribute */
+	  	if (!array_key_exists("updated", $entry)) {
+	      if (drupal_strtolower($label) == "updated") {
+	      	$value = $content;
+	      }
+	  	}
+  	  
+  	  /* Atom author attribute */			
+  	  if (!array_key_exists("author", $entry)) {
+			  if (drupal_strtolower($label) == "author") {
+	  	    $entry["author"] = _views_xml_format_author($content);
+	  	    continue;
+	      }
+	      elseif (drupal_strtolower($label) == "uid") {
+	  	    $entry["author"] = _views_xml_format_author($content);
+	  		  continue;
+	  	  }
+	  	}
+	  	
+	  	/* Atom link attribute */
+  	  if (!array_key_exists("link", $entry)) {
+			  if (drupal_strtolower($label) == "link") {
+	  	    $entry["link"] = $content;
+	  	    continue;
+	      }
+	  	}
+	  	
+  		/* Atom content attribute */
+  	  if (!array_key_exists("content", $entry)) {
+			  if (drupal_strtolower($label) == "content") {
+	  	    $entry["content"] = $content;
+	  	    continue;
+	      }
+	  	}
+	  	
+  	  /* Atom summary attribute */
+  	  if (!array_key_exists("summary", $entry)) {
+			  if (drupal_strtolower($label) == "summary") {
+	  	    $entry["summary"] = $content;
+	  	    continue;
+	      }
+	  	}	  	
+	  		  	
+	  	
+      /* Otherwise just use the $label and $content as element name and value */
+	    $entry[strtolower($label)] = $content;	  		  	   	
+  	} //for
+	  
+	  /* Check if id attribute exists and if not fall back to nid and try to use that */
+  	if (!array_key_exists("id", $entry)) {
+      if (array_key_exists("nid", $entry)) {
+      	$nid = $entry["nid"];
+	  	  $entry["id"] = "tag:$base_url,node-$nid";
+	    }
+  	}
+  	
+	  /* Check if title attribute exists and if not fall back to node_title */
+  	if (!array_key_exists("title", $entry)) {
+      if (array_key_exists("node_title", $entry)) {
+	  	  $entry["title"] = $entry["node_title"];
+	    }
+  	}
+  	
+  	/* Check if link attribute exists and if not fall back to constructing a link from the nid */
+  	if (!array_key_exists("link", $entry)) {
+      if (array_key_exists("nid", $entry)) {
+      	$nid = $entry["nid"];
+	  	  $entry["link"] = url("node/$nid", array('absolute' => TRUE));
+	    }
+  	}
+  	
+  	/* Check if updated attribute exists and if not fall back to other possible fields */
+	  if (!array_key_exists("updated", $entry)) {
+	    $value = NULL;
+	  	if (array_key_exists("last_updated", $entry)) {
+	      $value = $entry["last_updated"];
+	    }
+	    elseif (array_key_exists("updateddate", $entry)) {
+	      $value = $entry["updateddate"];
+	    }
+	  	elseif (array_key_exists("changed", $entry)) {
+	      $value = $entry["changed"];
+	    }
+	    elseif (array_key_exists("updatedcommenteddate", $entry)) {
+	      $value = $entry["updated/commented date"];
+	    }
+	    elseif (array_key_exists("lastcommenttime", $entry)) {
+	      $value = $entry["last comment time"];
+	    }
+	  	elseif (array_key_exists("last_comment_timestamp", $entry)) {
+	      $value = $entry["last_comment_timestamp"];
+	    }
+	    //_views_rdf_debug_stop($value);
+//	    if ($value) {
+//	      if (is_numeric($value))  { // timestamp
+//          //_views_xml_debug_stop($value);  
+//	        $value = format_date(intval($value), 'custom', DATE_ATOM);
+//	      }
+//        else  {    // string date
+//          $timestamp = strtotime($value);
+//        	if ($timestamp) $value = format_date($timestamp, 'custom', DATE_ATOM);
+//          //_views_xml_debug_stop($timestamp);
+//        }
+//        $entry["updated"] = $value;
+//        _views_xml_debug_stop($entry["updated"]);
+//	    }
+        $entry["updated"] = $value;
+  	}
+  	
+  	/* Check if content attribute exists and if not fall back to using node body */
+  	if (!array_key_exists("content", $entry)) {
+      if (array_key_exists("body", $entry)) {
+	  	  $entry["content"] = $entry["body"];
+	    }
+  	  if (array_key_exists("node_body", $entry)) {
+	  	  $entry["content"] = $entry["node_body"];
+	    }
+  	  if (array_key_exists("node_revisions_body", $entry)) {
+	  	  $entry["content"] = $entry["node_revisions_body"];
+	    }	    
+  	}
+  	
+    /* Check if summary attribute exists and if not fall back to using node teader */
+  	if (!array_key_exists("summary", $entry)) {
+      if (array_key_exists("node_teaser", $entry)) {
+	  	  $entry["summary"] = $entry["node_teaser"];
+	    }
+  	  if (array_key_exists("node_revisions_teaser", $entry)) {
+	  	  $entry["summary"] = $entry["node_revisions_teaser"];
+	    }
+  	}  	
+  	
+  	if (isset($entry["id"])) $entry["id"] = check_plain($entry["id"]);
+  	if (isset($entry["title"])) $entry["title"] = check_plain($entry["title"]);
+  	if (isset($entry["update"])) $entry["updated"] = check_plain($entry["updated"]);
+	  $entries[] = $entry;
+	  
+  }//for
+ 
+  $vars["entries"] = $entries;  
+}
diff -rupN ./views_datasource/views_json.info ./views_datasource_d7/views_json.info
--- ./views_datasource/views_json.info	2010-07-15 22:10:12.000000000 -0700
+++ ./views_datasource_d7/views_json.info	2011-02-24 22:36:58.000000000 -0800
@@ -2,12 +2,12 @@
 name = Views JSON
 description = "Views style plugin to render node content as JSON."
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
-php = 5.1
+; php = 5.1
 ; Information added by drupal.org packaging script on 2010-07-16
-version = "6.x-1.0-beta2"
-core = "6.x"
+version = "7.x-dev"
+core = "7.x"
 project = "views_datasource"
 datestamp = "1279257012"
 
diff -rupN ./views_datasource/views_json.module ./views_datasource_d7/views_json.module
--- ./views_datasource/views_json.module	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_json.module	2011-02-24 22:36:58.000000000 -0800
@@ -8,6 +8,10 @@
  * @see views_json.views.inc
  */
 
+function views_json_init(){
+	if (isset($_GET['sort_order']))
+		$_GET['sort_order'] = strtoupper($_GET['sort_order']);
+}
 
 function views_json_views_api() {
   return array(
@@ -109,6 +113,7 @@ function _views_json_render_multiple_fie
  *   Object containing all the raw and rendered fields  
  */
 function _views_json_render_fields($view, $row) {  
+//echo " render fields" ;
   $field_ids = array_keys($view->field);
   $rendered_fields = array();
   foreach ($field_ids as $id) {  
@@ -127,6 +132,8 @@ function _views_json_render_fields($view
     	else $field_raw = $view->field[$field->options['id']]->advanced_render($row);     	 
     }    
     else {
+//		var_dump($row);
+//	echo "Field: ".$field_output;
       $field_output = $view->field[$field->options['id']]->advanced_render($row);
       $field_raw = (isset($view->field[$id]->field_alias) && isset($row->{$view->field[$id]->field_alias})) ? $row->{$view->field[$id]->field_alias} : NULL;
     }
@@ -153,7 +160,7 @@ function _views_json_render_fields($view
       $object->id = $id;
       $object->content = $field_output;
       $object->raw = $field_raw;
-      $object->class = views_css_safe($id);
+      $object->class = drupal_clean_css_identifier(strtolower($id));//views_css_safe($id);
       $object->label = check_plain($view->field[$id]->label());
       $object->is_multiple = $field_is_multiple;       
       $rendered_fields[$id] = $object;      
diff -rupN ./views_datasource/views_json.views.inc ./views_datasource_d7/views_json.views.inc
--- ./views_datasource/views_json.views.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_json.views.inc	2011-02-24 22:36:58.000000000 -0800
@@ -9,6 +9,141 @@
  * @ingroup views_plugins
  */
 
+/**
+ * Implementation of views_plugin_style
+ *
+ * Comment: moved from views_plugin_style_xhtml.inc to allow recognition by Drupal, which
+ * expects the class to be declared in the same file as the style declaration at the end
+ * of this file (Hovhannes Tumanyan)
+ */
+class views_plugin_style_json extends views_plugin_style {
+  /** 
+   * Implementation of views_plugin_style::option_definition 
+   */ 
+  	function option_definition() {
+      $options = parent::option_definition();
+      $options['root_object'] = array('default' => 'nodes', 'translatable' => FALSE);
+      $options['top_child_object'] = array('default' => 'node', 'translatable' => FALSE);
+      $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
+      $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
+      $options['format'] = array('default' => 'simple', 'translatable' => FALSE);
+      $options['jsonp_prefix'] = array('default'=> NULL, 'translatable' => FALSE);
+      $options['content_type'] = array('default' => 'default', 'translatable' => FALSE);
+      $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
+      return $options;
+  	}
+  	
+  /**
+   * Provide a form for setting options.
+   *
+   * @param $form
+   * @param $form_state
+   */
+  function options_form(&$form, &$form_state) {
+  	$form['root_object'] = array(
+    '#type' => 'textfield',
+    '#title' => ('Root object name'),
+    '#default_value' => $this->options['root_object'],
+    '#description' => ('The name of the root object in the JSON document. e.g nodes or users or forum_posts'),
+      //'#process' => array('views_process_dependency'),
+      //'#dependency' => array('radios:schema' => array('raw')),      
+    );
+  	$form['top_child_object'] = array(
+    '#type' => 'textfield',
+    '#title' => ('Top-level child object'),
+    '#default_value' => $this->options['top_child_object'],
+    '#description' => ('The name of each top-level child object in the JSON document. e.g node or user or forum_post'),
+    );    
+  	$form['field_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Field output',
+      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
+      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
+      '#default_value' => $this->options['field_output'],
+    );
+    $form['plaintext_output'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Plaintext output'),
+      '#default_value'  => $this->options['plaintext_output'],
+      '#description'    => ('For each row in the view, strip all markup from the field output.'),
+    );
+    $form['format'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('JSON data format'),
+      '#options'        => array(
+        'simple'  => ('Simple'),
+        'exhibit' => ('MIT Simile/Exhibit'),
+        'jqgrid' => ('To be consumed by jqGrid'),
+      ),
+      '#default_value'  => $this->options['format'],
+      '#description'    => ('What object format will be used for JSON output.')
+    );
+  	$form['jsonp_prefix'] = array(
+    '#type' => 'textfield',
+    '#title' => ('JSONP prefix'),
+    '#default_value' => $this->options['jsonp_prefix'],
+    '#description' => ('If used the JSON output will be enclosed with parentheses and prefixed by this label, as in the JSONP format.'),
+    );    
+    
+    $form['content_type'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Content-Type'),
+      '#options'        => array(
+        'default'       => ("Default: application/json"),
+        'text/json'     => ('text/json'),
+       ),
+      '#default_value'  => $this->options['content_type'],
+      '#description'    => ('The Content-Type header that will be sent with the JSON output.')
+    );
+    $form['using_views_api_mode'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Views API mode'),
+      '#default_value'  => $this->options['using_views_api_mode'],
+      '#description'    => ('Not using View API mode means the JSON gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
+    );
+  }
+
+  /**
+   * Implementation of view_style_plugin::theme_functions(). Returns an array of theme functions to use
+   * for the current style plugin
+   * @return array 
+   */
+  function theme_functions() {
+    $options = $this->options;
+    if ($options['format'] == 'simple') $hook = 'views_views_json_style_simple';
+	if ($options['format'] == 'jqgrid') $hook = 'views_views_json_style_jqgrid';
+    if ($options['format'] == 'exhibit') $hook = 'views_views_json_style_exhibit';	  
+
+  	return views_theme_functions($hook, $this->view, $this->display);
+  }
+
+/**
+ * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
+ * @return array
+ */  
+  function additional_theme_functions() {
+  	return array();
+  }
+    
+  /**
+   * Implementation of view_style_plugin::render()
+   */
+  function render() {
+
+  	$view = $this->view;
+  	$options = $this->options;
+  	$field = $view->field;
+
+ 	  $rows = array();
+
+    foreach ($view->result as $row) {
+      $rows[] = _views_json_render_fields($view, $row);
+    }
+
+    return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'rows' => $rows)); 	  
+ 	}
+ 
+}  
 
 /**
  * Implementation of hook_views_plugin().
@@ -22,11 +157,11 @@ function views_json_views_plugins() {
           'title'         => ('JSON data document'),
 	        'path'          => $path,
 	        'help'          => ('Displays nodes in the JSON data format.'), 
-          'handler'         => 'views_plugin_style_json',
-		      'theme'           => 'views_views_json_style',
+            'handler'         => 'views_plugin_style_json',
+		    'theme'           => 'views_views_json_style',
 	        'theme file'      => 'views_views_json_style.theme.inc',
 	        'theme path'      => $path.'/theme',
-	        'additional themes' => array ('views_views_json_style_simple' => 'style', 'views_views_json_style_exhibit' => 'style'),
+	        'additional themes' => array ('views_views_json_style_simple' => 'style', 'views_views_json_style_exhibit' => 'style', 'views_views_json_style_jqgrid' => 'style'),
           'uses row plugin' => FALSE,
           'uses fields'     => TRUE,
           'uses options'    => TRUE,
@@ -36,4 +171,4 @@ function views_json_views_plugins() {
       ),
     ),
   );
-}
+}
\ No newline at end of file
diff -rupN ./views_datasource/views_plugin_style_json.inc ./views_datasource_d7/views_plugin_style_json.inc
--- ./views_datasource/views_plugin_style_json.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_plugin_style_json.inc	1969-12-31 16:00:00.000000000 -0800
@@ -1,137 +0,0 @@
-<?php
-// $Id: views_plugin_style_json.inc,v 1.1.2.11 2010/07/15 07:34:48 allisterbeharry Exp $
-
-/**
- * @file
- * Implementation of views_plugin_style for views_json
- */
-
-
-/**
- * Implementation of views_plugin_style
- */
-class views_plugin_style_json extends views_plugin_style {
-  /** 
-   * Implementation of views_plugin_style::option_definition 
-   */ 
-  	function option_definition() {
-      $options = parent::option_definition();
-      $options['root_object'] = array('default' => 'nodes', 'translatable' => FALSE);
-      $options['top_child_object'] = array('default' => 'node', 'translatable' => FALSE);
-      $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
-      $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
-      $options['format'] = array('default' => 'simple', 'translatable' => FALSE);
-      $options['jsonp_prefix'] = array('default'=> NULL, 'translatable' => FALSE);
-      $options['content_type'] = array('default' => 'default', 'translatable' => FALSE);
-      $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
-      return $options;
-  	}
-  	
-  /**
-   * Provide a form for setting options.
-   *
-   * @param $form
-   * @param $form_state
-   */
-  function options_form(&$form, &$form_state) {
-  	$form['root_object'] = array(
-    '#type' => 'textfield',
-    '#title' => ('Root object name'),
-    '#default_value' => $this->options['root_object'],
-    '#description' => ('The name of the root object in the JSON document. e.g nodes or users or forum_posts'),
-      //'#process' => array('views_process_dependency'),
-      //'#dependency' => array('radios:schema' => array('raw')),      
-    );
-  	$form['top_child_object'] = array(
-    '#type' => 'textfield',
-    '#title' => ('Top-level child object'),
-    '#default_value' => $this->options['top_child_object'],
-    '#description' => ('The name of each top-level child object in the JSON document. e.g node or user or forum_post'),
-    );    
-  	$form['field_output']  = array(
-      '#type' => 'radios',
-      '#title' => 'Field output',
-      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
-      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
-      '#default_value' => $this->options['field_output'],
-    );
-    $form['plaintext_output'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Plaintext output'),
-      '#default_value'  => $this->options['plaintext_output'],
-      '#description'    => ('For each row in the view, strip all markup from the field output.'),
-    );
-    $form['format'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('JSON data format'),
-      '#options'        => array(
-        'simple'  => ('Simple'),
-        'exhibit' => ('MIT Simile/Exhibit'),
-      ),
-      '#default_value'  => $this->options['format'],
-      '#description'    => ('What object format will be used for JSON output.')
-    );
-  	$form['jsonp_prefix'] = array(
-    '#type' => 'textfield',
-    '#title' => ('JSONP prefix'),
-    '#default_value' => $this->options['jsonp_prefix'],
-    '#description' => ('If used the JSON output will be enclosed with parentheses and prefixed by this label, as in the JSONP format.'),
-    );    
-    
-    $form['content_type'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('Content-Type'),
-      '#options'        => array(
-        'default'       => ("Default: application/json"),
-        'text/json'     => ('text/json'),
-       ),
-      '#default_value'  => $this->options['content_type'],
-      '#description'    => ('The Content-Type header that will be sent with the JSON output.')
-    );
-    $form['using_views_api_mode'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Views API mode'),
-      '#default_value'  => $this->options['using_views_api_mode'],
-      '#description'    => ('Not using View API mode means the JSON gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
-    );
-  }
-
-  /**
-   * Implementation of view_style_plugin::theme_functions(). Returns an array of theme functions to use
-   * for the current style plugin
-   * @return array 
-   */
-  function theme_functions() {
-    $options = $this->options;
-    if ($options['format'] == 'simple') $hook = 'views_views_json_style_simple';
-	  if ($options['format'] == 'exhibit') $hook = 'views_views_json_style_exhibit';	  
-  	return views_theme_functions($hook, $this->view, $this->display);
-  }
-
-/**
- * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
- * @return array
- */  
-  function additional_theme_functions() {
-  	return array();
-  }
-    
-  /**
-   * Implementation of view_style_plugin::render()
-   */
-  function render() {
-  	$view = $this->view;
-  	$options = $this->options;
-  	$field = $view->field;
-
- 	  $rows = array();
-
-    foreach ($view->result as $row) {
-      $rows[] = _views_json_render_fields($view, $row);
-    }
- 	  
-    return theme($this->theme_functions(), $this->view, $this->options, $rows); 	  
- 	}
- 
-}  
-
diff -rupN ./views_datasource/views_plugin_style_rdf.inc ./views_datasource_d7/views_plugin_style_rdf.inc
--- ./views_datasource/views_plugin_style_rdf.inc	2010-07-15 21:39:03.000000000 -0700
+++ ./views_datasource_d7/views_plugin_style_rdf.inc	1969-12-31 16:00:00.000000000 -0800
@@ -1,137 +0,0 @@
-<?php
-// $Id: views_plugin_style_rdf.inc,v 1.1.2.13 2010/07/16 04:39:03 allisterbeharry Exp $
-
-/**
- * @file
- * Implementation of views_plugin_style for views_rdf
- */
-
-
-/**
- * Implementation of views_plugin_style
- */
-class views_plugin_style_rdf extends views_plugin_style {
-	
-  /** 
-   * Implementation of views_plugin_style::option_definition 
-   */ 
-	function option_definition() {
-		global $user;
-    $options = parent::option_definition();
-    $options['vocabulary'] = array('default' => 'foaf', 'translatable' => FALSE);
-    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
-    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
-    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
-    $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
-    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
-    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
-    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
-    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
-    return $options;
-  }	
-  
-  /**
-   * Provide a form for setting options.
-   *
-   * @param $form
-   * @param $form_state
-   */
-  function options_form(&$form, &$form_state) {
-  	$form['vocabulary'] = array(
-      '#type' => 'radios',
-      '#title' => ('RDF vocabulary'),
-      '#description' => ('The RDF vocabulary to use when rendering the view.'),    
-      '#options' => array('foaf' => ('FOAF'), 'sioc' => ('SIOC'), 'doap' => ('DOAP')),
-      '#default_value' => $this->options['vocabulary'],
-    );
-   $form['field_output']  = array(
-      '#type' => 'radios',
-      '#title' => 'Field output',
-      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
-      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
-      '#default_value' => $this->options['field_output'],
-    );
-    $form['plaintext_output'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Plaintext output'),
-      '#default_value'  => $this->options['plaintext_output'],
-      '#description'    => ('For each row in the view, strip all markup from the field output.'),
-    );
-    $form['escape_as_CDATA']  = array(
-      '#type' => 'radios',
-      '#title' => 'Escape row content as CDATA',
-      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
-      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
-      '#default_value' => $this->options['escape_as_CDATA'],
-    );
-    $form['header'] = array (
-      '#type' => 'textarea',
-      '#title' => 'XML document header',
-      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
-      '#default_value' => $this->options['header'], 
-      );
-    $form['content_type'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('Content-Type'),
-      '#options'        => array(
-         'default'      => ("Default: application/rdf+xml for FOAF and SIOC documents."),  
-         'text/xml'     => 'text/xml',
-       ),
-      '#default_value'  => $this->options['content_type'],
-      '#description'    => ('The Content-Type header that will be sent with the XML output.')
-    );
-    $form['author'] = array (
-      '#type' => 'textfield',
-      '#title' => 'View author',
-      '#description' => 'The Drupal user name of the person who authored this view.',
-      '#default_value' => $this->options['author'], 
-      );     
-    $form['using_views_api_mode'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Views API mode'),
-      '#default_value'  => $this->options['using_views_api_mode'],
-      '#description'    => ('Not using View API mode means the RDF gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
-    );
-  }
-
-  /**
-   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
-   * for the current style plugin
-   * @return array 
-   */
-  function theme_functions() {
-    $options = $this->options;
-    if ($options['vocabulary'] == 'foaf') $hook = 'views_views_rdf_style_foaf';
-	  if ($options['vocabulary'] == 'sioc') $hook = 'views_views_rdf_style_sioc';
-	  if ($options['vocabulary'] == 'doap') $hook = 'views_views_rdf_style_doap';
-	   
-  	return views_theme_functions($hook, $this->view, $this->display);
-  }
-
-/**
- * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
- * @return array
- */  
-  function additional_theme_functions() {
-  	return array();
-  }
-  
-  /**
-   * Implementation of view_style_plugin::render()
-   */
-  function render() {
-  	$view = $this->view;
-  	$options = $this->options;
-  	$field = $view->field;
-
- 	  $rows = array();
- 	 
-    foreach ($view->result as $row) {
-      $rows[] = _views_rdf_render_fields($view, $row);
-    }
-    
- 	  return theme($this->theme_functions(), $this->view, $this->options, $rows); 	  
- 	}
-
-}
-    
\ No newline at end of file
diff -rupN ./views_datasource/views_plugin_style_xhtml.inc ./views_datasource_d7/views_plugin_style_xhtml.inc
--- ./views_datasource/views_plugin_style_xhtml.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_plugin_style_xhtml.inc	1969-12-31 16:00:00.000000000 -0800
@@ -1,141 +0,0 @@
-<?php
-// $Id: views_plugin_style_xhtml.inc,v 1.1.2.10 2010/07/15 07:34:48 allisterbeharry Exp $
-
-/**
- * @file
- * Implementation of views_plugin_style for views_xhtml
- */
-
-
-/**
- * Implementation of views_plugin_style
- */
-class views_plugin_style_xhtml extends views_plugin_style {
-  /**
-   * Set default options
-   */
-  function option_definition() {
-    $options = parent::option_definition();
-    $options['format'] = array('default' => 'hcard', 'translatable' => FALSE);
-    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
-    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
-    /*$options['skip_empty_fields'] = array('default' => TRUE, 'translatable' => FALSE);*/
-    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
-    $options['content_type'] = array('default' => 'text/xhtml', 'translatable' => FALSE);
-    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
-    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
-    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
-    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
-    return $options;
-  }
-
-  /**
-   * Provide a form for setting options.
-   *
-   * @param $form
-   * @param $form_state
-   */
-  function options_form(&$form, &$form_state) {
-    $form['format'] = array(
-      '#type' => 'radios',
-      '#title' => ('Microformat'),
-      '#options' => array('hcard' => ('hCard'), 'hcalendar' => ('hCalendar')),
-      '#default_value' => $this->options['format'],
-    );
-   $form['field_output']  = array(
-      '#type' => 'radios',
-      '#title' => 'Field output',
-      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
-      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
-      '#default_value' => $this->options['field_output'],
-    );
-    $form['plaintext_output'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Plaintext output'),
-      '#default_value'  => $this->options['plaintext_output'],
-      '#description'    => ('For each row in the view, strip all markup from the field output.'),
-    );
-    /*
-    $form['skip_empty_fields'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Skip adding fields that are empty.'),
-      '#default_value'  => $this->options['skip_empty_fields'],
-      '#description'    => ('For each row in the view, skip adding a field if the field value is NULL or blank.'),
-    );*/    
-    $form['escape_as_CDATA']  = array(
-      '#type' => 'radios',
-      '#title' => 'Escape row content as CDATA',
-      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
-      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
-      '#default_value' => $this->options['escape_as_CDATA'],
-      //'#process' => array('views_process_dependency'),
-      //'#dependency' => array('edit-style-options-element-output-options' => array('nested')),
-    );
-    $form['header'] = array (
-      '#type' => 'textarea',
-      '#title' => 'XML document header',
-      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
-      '#default_value' => $this->options['header'], 
-      );
-    $form['content_type'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('Content-Type'),
-      '#options'        => array(
-         'default'      => ("Default: text/xhtml"),  
-         'text/xml'     => 'text/xml',
-         'text/html'    => 'text/html',
-       ),
-      '#default_value'  => $this->options['content_type'],
-      '#description'    => ('The Content-Type header that will be sent with the XHTML output.')
-    );
-    $form['author'] = array (
-      '#type' => 'textfield',
-      '#title' => 'View author',
-      '#description' => 'The Drupal user name of the person who authored this view.',
-      '#default_value' => $this->options['author'], 
-      );     
-    $form['using_views_api_mode'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Views API mode'),
-      '#default_value'  => $this->options['using_views_api_mode'],
-      '#description'    => ('Not using View API mode means the JSON gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
-    );    
-  }
-
-  /**
-   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
-   * for the current style plugin
-   * @return array 
-   */
-  function theme_functions() {
-    $options = $this->options;
-    if ($options['format'] == 'hcard') $hook = 'views_views_xhtml_style_hcard';
-	  if ($options['format'] == 'hcalendar') $hook = 'views_views_xhtml_style_hcalendar'; 
-  	return views_theme_functions($hook, $this->view, $this->display);
-  }
-
-/**
- * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
- * @return array
- */  
-  function additional_theme_functions() {
-  	return array();
-  }
-    
-  /**
-   * Implementation of view_style_plugin::render()
-   */
-  function render() {
-  	$view = $this->view;
-  	$options = $this->options;
-  	$field = $view->field;
-
- 	  $rows = array();
- 	 
-    foreach ($view->result as $row) {
-      $rows[] = _views_xhtml_render_fields($view, $row);
-    }
-    
- 	  return theme($this->theme_functions(), $this->view, $this->options, $rows); 	  
- 	}  
-}
diff -rupN ./views_datasource/views_plugin_style_xml.inc ./views_datasource_d7/views_plugin_style_xml.inc
--- ./views_datasource/views_plugin_style_xml.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_plugin_style_xml.inc	1969-12-31 16:00:00.000000000 -0800
@@ -1,180 +0,0 @@
-<?php
-// $Id: views_plugin_style_xml.inc,v 1.1.2.15 2010/07/15 07:34:48 allisterbeharry Exp $
-
-/**
- * @file
- * Implementation of views_plugin_style for views_xml
- */
-
-
-/**
- * Implementation of views_plugin_style
- */
-class views_plugin_style_xml extends views_plugin_style {
-
-  /** 
-   * Implementation of views_plugin_style::option_definition 
-   */ 
-	function option_definition() {
-		global $user;
-    $options = parent::option_definition();
-    $options['schema'] = array('default' => 'raw', 'translatable' => FALSE);
-    $options['root_element'] = array('default' => 'node', 'translatable' => FALSE);
-    $options['top_child_object'] = array('default' => 'node', 'translatable' => FALSE);
-    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
-    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
-    /*$options['skip_empty_fields'] = array('default' => TRUE, 'translatable' => FALSE);*/
-    $options['element_output'] = array('default' => 'nested', 'translatable' => FALSE);
-    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
-    $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
-    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
-    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
-    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
-    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
-    return $options;
-  }
-  
-  /**
-   * Provide a form for setting options.
-   *
-   * @param $form
-   * @param $form_state
-   */
-  function options_form(&$form, &$form_state) {
-  	$form['schema'] = array(
-      '#type' => 'radios',
-      '#title' => ('XML schema'),
-      '#description' => ('The schema or format of the XML data document.'),    
-      '#options' => array('raw' => ('Raw XML'), 'opml' => ('OPML'), 'atom' => ('Atom')),
-      '#default_value' => $this->options['schema'],
-    );
-    $form['root_element'] = array(
-      '#type' => 'textfield',
-      '#title' => ('Root element name'),
-      '#default_value' => $this->options['root_element'],
-      '#description' => ('The name of the root element in a raw XML document.'),
-      //'#process' => array('views_process_dependency'),
-      //'#dependency' => array('edit-style-options-schema' => array('raw')),  
-    );
-  	$form['top_child_object'] = array(
-    '#type' => 'textfield',
-    '#title' => ('Top-level child element name'),
-    '#default_value' => $this->options['top_child_object'],
-    '#description' => ('The name of each top-level child object in a raw XML document. e.g node or user or forum_post'),
-    );       
-   $form['field_output']  = array(
-      '#type' => 'radios',
-      '#title' => 'Field output',
-      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
-      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
-      '#default_value' => $this->options['field_output'],
-    );
-    $form['plaintext_output'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Plaintext output'),
-      '#default_value'  => $this->options['plaintext_output'],
-      '#description'    => ('For each row in the view, strip all markup from the field output.'),
-    );
-    /*
-    $form['skip_empty_fields'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Skip adding fields that are empty.'),
-      '#default_value'  => $this->options['skip_empty_fields'],
-      '#description'    => ('For each row in the view, skip adding a field if the field value is NULL or blank.'),
-    );*/    
-    $form['element_output']  = array(
-      '#type' => 'radios',
-      '#title' => 'Element output',
-      '#description' => 'For each row in the view, fields can be output as either nested XML child elements, or attributes of the raw XML element.',
-      '#options' => array('nested' => ('Nested'), 'attributes' => ('Attributes')),
-      '#default_value' => $this->options['element_output'],
-    );
-    $form['escape_as_CDATA']  = array(
-      '#type' => 'radios',
-      '#title' => 'Escape row content as CDATA',
-      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
-      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
-      '#default_value' => $this->options['escape_as_CDATA'],
-      //'#process' => array('views_process_dependency'),
-      //'#dependency' => array('edit-style-options-element-output-options' => array('nested')),
-    );
-    $form['header'] = array (
-      '#type' => 'textarea',
-      '#title' => 'XML document header',
-      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
-      '#default_value' => $this->options['header'], 
-      );
-    $form['content_type'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('Content-Type'),
-      '#options'        => array(
-         'default'      => ("Default: text/xml for raw documents, text/html for OPML, application/atom+xml for Atom."),  
-         'text/xml'     => 'text/xml',
-         'text/html'    => 'text/html',
-         'text/x-opml'  => 'text/x-opml'
-         ),
-      '#default_value'  => $this->options['content_type'],
-      '#description'    => ('The Content-Type header that will be sent with the XML output.')
-    );
-    $form['author'] = array (
-      '#type' => 'textfield',
-      '#title' => 'View author',
-      '#description' => 'The Drupal user name of the person who authored this view.',
-      '#default_value' => $this->options['author'], 
-      );     
-    $form['using_views_api_mode'] = array(
-      '#type'           => 'checkbox',
-      '#title'          => ('Views API mode'),
-      '#default_value'  => $this->options['using_views_api_mode'],
-      '#description'    => ('Not using View API mode means the XML gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
-    );
-    /*
-    $form['action_on_missing_field'] = array(
-      '#type'           => 'radios',
-      '#title'          => ('Action on missing field'),
-      '#options' => array('none' => ('Take no action if a required field is missing.'), 'warn' => ('Warn about the missing fields in preview mode.'), 'stop'=>t('Stop page processing and send an error message if a required field is missing.')),
-      '#default_value'  => $this->options['action_on_missing_field'],
-      '#description'    => ('Action to take if no field can be mapped to a required element or schema for the selected XML schema.'),
-    );*/      
-    
-  } 
- 	
-  /**
-   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
-   * for the current style plugin
-   * @return array 
-   */
-  function theme_functions() {
-    $options = $this->options;
-    if ($options['schema'] == 'raw') $hook = 'views_views_xml_style_raw';
-	  if ($options['schema'] == 'opml') $hook = 'views_views_xml_style_opml';
-	  if ($options['schema'] == 'atom') $hook = 'views_views_xml_style_atom'; 
-  	return views_theme_functions($hook, $this->view, $this->display);
-  }
-
-/**
- * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
- * @return array
- */  
-  function additional_theme_functions() {
-  	return array();
-  }
-  
-  /**
-   * Implementation of view_style_plugin::render()
-   */
-  function render() {
-  	$view = $this->view;
-  	$options = $this->options;
-  	$field = $view->field;
-  	
- 	  $rows = array();
-    
- 	  foreach ($view->result as $row) {    	      
-    	$rows[] = _views_xml_render_fields($view, $row);        
-    }
-    
-    return theme($this->theme_functions(), $this->view, $this->options, $rows);    	  
- 	}
- 
-}
\ No newline at end of file
diff -rupN ./views_datasource/views_rdf.info ./views_datasource_d7/views_rdf.info
--- ./views_datasource/views_rdf.info	2010-07-15 22:10:12.000000000 -0700
+++ ./views_datasource_d7/views_rdf.info	2011-02-24 22:36:58.000000000 -0800
@@ -2,12 +2,12 @@
 name = Views RDF
 description = "Views style plugin to render node content as RDF."
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
 php = 5.1
 ; Information added by drupal.org packaging script on 2010-07-16
-version = "6.x-1.0-beta2"
-core = "6.x"
+version = "7.x-dev"
+core = "7.x"
 project = "views_datasource"
 datestamp = "1279257012"
 
diff -rupN ./views_datasource/views_rdf.module ./views_datasource_d7/views_rdf.module
--- ./views_datasource/views_rdf.module	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_rdf.module	2011-02-24 22:36:58.000000000 -0800
@@ -153,7 +153,7 @@ function _views_rdf_render_fields($view,
       $object->id = $id;
       $object->content = $field_output;
       $object->raw = $field_raw;
-      $object->class = views_css_safe($id);
+      $object->class = drupal_clean_css_identifier(strtolower($id));
       $object->label = check_plain($view->field[$id]->label());
       $object->is_multiple = $field_is_multiple;       
       $rendered_fields[$id] = $object;      
diff -rupN ./views_datasource/views_rdf.views.inc ./views_datasource_d7/views_rdf.views.inc
--- ./views_datasource/views_rdf.views.inc	2010-07-15 21:39:03.000000000 -0700
+++ ./views_datasource_d7/views_rdf.views.inc	2011-02-24 22:36:58.000000000 -0800
@@ -11,6 +11,138 @@
 
 
 /**
+ * Implementation of views_plugin_style
+ *
+ * Comment: moved from views_plugin_style_xhtml.inc to allow recognition by Drupal, which
+ * expects the class to be declared in the same file as the style declaration at the end
+ * of this file (Hovhannes Tumanyan)
+ */
+class views_plugin_style_rdf extends views_plugin_style {
+	
+  /** 
+   * Implementation of views_plugin_style::option_definition 
+   */ 
+	function option_definition() {
+		global $user;
+    $options = parent::option_definition();
+    $options['vocabulary'] = array('default' => 'foaf', 'translatable' => FALSE);
+    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
+    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
+    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
+    $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
+    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
+    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
+    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
+    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
+    return $options;
+  }	
+  
+  /**
+   * Provide a form for setting options.
+   *
+   * @param $form
+   * @param $form_state
+   */
+  function options_form(&$form, &$form_state) {
+  	$form['vocabulary'] = array(
+      '#type' => 'radios',
+      '#title' => ('RDF vocabulary'),
+      '#description' => ('The RDF vocabulary to use when rendering the view.'),    
+      '#options' => array('foaf' => ('FOAF'), 'sioc' => ('SIOC'), 'doap' => ('DOAP')),
+      '#default_value' => $this->options['vocabulary'],
+    );
+   $form['field_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Field output',
+      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
+      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
+      '#default_value' => $this->options['field_output'],
+    );
+    $form['plaintext_output'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Plaintext output'),
+      '#default_value'  => $this->options['plaintext_output'],
+      '#description'    => ('For each row in the view, strip all markup from the field output.'),
+    );
+    $form['escape_as_CDATA']  = array(
+      '#type' => 'radios',
+      '#title' => 'Escape row content as CDATA',
+      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
+      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
+      '#default_value' => $this->options['escape_as_CDATA'],
+    );
+    $form['header'] = array (
+      '#type' => 'textarea',
+      '#title' => 'XML document header',
+      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
+      '#default_value' => $this->options['header'], 
+      );
+    $form['content_type'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Content-Type'),
+      '#options'        => array(
+         'default'      => ("Default: application/rdf+xml for FOAF and SIOC documents."),  
+         'text/xml'     => 'text/xml',
+       ),
+      '#default_value'  => $this->options['content_type'],
+      '#description'    => ('The Content-Type header that will be sent with the XML output.')
+    );
+    $form['author'] = array (
+      '#type' => 'textfield',
+      '#title' => 'View author',
+      '#description' => 'The Drupal user name of the person who authored this view.',
+      '#default_value' => $this->options['author'], 
+      );     
+    $form['using_views_api_mode'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Views API mode'),
+      '#default_value'  => $this->options['using_views_api_mode'],
+      '#description'    => ('Not using View API mode means the RDF gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
+    );
+  }
+
+  /**
+   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
+   * for the current style plugin
+   * @return array 
+   */
+  function theme_functions() {
+    $options = $this->options;
+    if ($options['vocabulary'] == 'foaf') $hook = 'views_views_rdf_style_foaf';
+	  if ($options['vocabulary'] == 'sioc') $hook = 'views_views_rdf_style_sioc';
+	  if ($options['vocabulary'] == 'doap') $hook = 'views_views_rdf_style_doap';
+	   
+  	return views_theme_functions($hook, $this->view, $this->display);
+  }
+
+/**
+ * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
+ * @return array
+ */  
+  function additional_theme_functions() {
+  	return array();
+  }
+  
+  /**
+   * Implementation of view_style_plugin::render()
+   */
+  function render() {
+  	$view = $this->view;
+  	$options = $this->options;
+  	$field = $view->field;
+
+ 	  $rows = array();
+ 	 
+    foreach ($view->result as $row) {
+      $rows[] = _views_rdf_render_fields($view, $row);
+    }
+  
+ 	  return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'rows' => $rows));
+ 	}
+
+}
+
+/**
  * Implementation of hook_views_plugin().
  */
 function views_rdf_views_plugins() {
diff -rupN ./views_datasource/views_rdf.views.inc~ ./views_datasource_d7/views_rdf.views.inc~
--- ./views_datasource/views_rdf.views.inc~	1969-12-31 16:00:00.000000000 -0800
+++ ./views_datasource_d7/views_rdf.views.inc~	2011-02-24 22:36:58.000000000 -0800
@@ -0,0 +1,168 @@
+<?php
+// $Id: views_rdf.views.inc,v 1.1.2.10 2010/07/16 04:39:03 allisterbeharry Exp $
+
+/**
+ * @file
+ * Views style plugin to render nodes in the RDF data format.
+ *
+ * @see views-view-rdf.tpl.php
+ * @ingroup views_plugins
+ */
+
+
+/**
+ * Implementation of views_plugin_style
+ */
+class views_plugin_style_rdf extends views_plugin_style {
+	
+  /** 
+   * Implementation of views_plugin_style::option_definition 
+   */ 
+	function option_definition() {
+		global $user;
+    $options = parent::option_definition();
+    $options['vocabulary'] = array('default' => 'foaf', 'translatable' => FALSE);
+    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
+    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
+    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
+    $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
+    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
+    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
+    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
+    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
+    return $options;
+  }	
+  
+  /**
+   * Provide a form for setting options.
+   *
+   * @param $form
+   * @param $form_state
+   */
+  function options_form(&$form, &$form_state) {
+  	$form['vocabulary'] = array(
+      '#type' => 'radios',
+      '#title' => ('RDF vocabulary'),
+      '#description' => ('The RDF vocabulary to use when rendering the view.'),    
+      '#options' => array('foaf' => ('FOAF'), 'sioc' => ('SIOC'), 'doap' => ('DOAP')),
+      '#default_value' => $this->options['vocabulary'],
+    );
+   $form['field_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Field output',
+      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
+      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
+      '#default_value' => $this->options['field_output'],
+    );
+    $form['plaintext_output'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Plaintext output'),
+      '#default_value'  => $this->options['plaintext_output'],
+      '#description'    => ('For each row in the view, strip all markup from the field output.'),
+    );
+    $form['escape_as_CDATA']  = array(
+      '#type' => 'radios',
+      '#title' => 'Escape row content as CDATA',
+      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
+      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
+      '#default_value' => $this->options['escape_as_CDATA'],
+    );
+    $form['header'] = array (
+      '#type' => 'textarea',
+      '#title' => 'XML document header',
+      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
+      '#default_value' => $this->options['header'], 
+      );
+    $form['content_type'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Content-Type'),
+      '#options'        => array(
+         'default'      => ("Default: application/rdf+xml for FOAF and SIOC documents."),  
+         'text/xml'     => 'text/xml',
+       ),
+      '#default_value'  => $this->options['content_type'],
+      '#description'    => ('The Content-Type header that will be sent with the XML output.')
+    );
+    $form['author'] = array (
+      '#type' => 'textfield',
+      '#title' => 'View author',
+      '#description' => 'The Drupal user name of the person who authored this view.',
+      '#default_value' => $this->options['author'], 
+      );     
+    $form['using_views_api_mode'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Views API mode'),
+      '#default_value'  => $this->options['using_views_api_mode'],
+      '#description'    => ('Not using View API mode means the RDF gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
+    );
+  }
+
+  /**
+   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
+   * for the current style plugin
+   * @return array 
+   */
+  function theme_functions() {
+    $options = $this->options;
+    if ($options['vocabulary'] == 'foaf') $hook = 'views_views_rdf_style_foaf';
+	  if ($options['vocabulary'] == 'sioc') $hook = 'views_views_rdf_style_sioc';
+	  if ($options['vocabulary'] == 'doap') $hook = 'views_views_rdf_style_doap';
+	   
+  	return views_theme_functions($hook, $this->view, $this->display);
+  }
+
+/**
+ * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
+ * @return array
+ */  
+  function additional_theme_functions() {
+  	return array();
+  }
+  
+  /**
+   * Implementation of view_style_plugin::render()
+   */
+  function render() {
+  	$view = $this->view;
+  	$options = $this->options;
+  	$field = $view->field;
+
+ 	  $rows = array();
+ 	 
+    foreach ($view->result as $row) {
+      $rows[] = _views_rdf_render_fields($view, $row);
+    }
+  
+ 	  return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'rows' => $rows));
+ 	}
+
+}
+
+/**
+ * Implementation of hook_views_plugin().
+ */
+function views_rdf_views_plugins() {
+	$path = drupal_get_path('module', 'views_rdf');
+  return array(
+    'module'  => 'views_rdf',
+    'style'   => array(                 // declare the views_rdf style plugin
+      'views_rdf' => array(
+        'title'           => ('RDF data document'),
+        'path'            => $path,
+        'help'            => ('Displays nodes in a view using the RDF data format.'),
+        'handler'         => 'views_plugin_style_rdf',
+        'theme'           => 'views_views_rdf_style',
+  	    'theme file'      => 'views_views_rdf_style.theme.inc',
+	      'theme path'      => $path.'/theme',
+        'additional themes' => array('views_views_rdf_style_foaf' => 'style', 'views_views_rdf_style_sioc' => 'style', 'views_views_rdf_style_doap' => 'style'),
+        'uses row plugin' => FALSE,
+        'uses fields'     => TRUE,
+        'uses options'    => TRUE,
+        'type'            => 'normal',
+  	    'help_topic'      => 'style-rdf',
+	      'even empty'      => TRUE
+      ),
+    ),
+  );
+}
+
diff -rupN ./views_datasource/views_xhtml.info ./views_datasource_d7/views_xhtml.info
--- ./views_datasource/views_xhtml.info	2010-07-15 22:10:12.000000000 -0700
+++ ./views_datasource_d7/views_xhtml.info	2011-02-24 22:36:58.000000000 -0800
@@ -2,12 +2,12 @@
 name = Views XHTML
 description = "Views style plugin to render node content as XHTML microformats."
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
 php = 5.1
 ; Information added by drupal.org packaging script on 2010-07-16
-version = "6.x-1.0-beta2"
-core = "6.x"
+version = "7.x-dev"
+core = "7.x"
 project = "views_datasource"
 datestamp = "1279257012"
 
diff -rupN ./views_datasource/views_xhtml.module ./views_datasource_d7/views_xhtml.module
--- ./views_datasource/views_xhtml.module	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_xhtml.module	2011-02-24 22:36:58.000000000 -0800
@@ -152,7 +152,7 @@ function _views_xhtml_render_fields($vie
       $object->id = $id;
       $object->content = $field_output;
       $object->raw = $field_raw;
-      $object->class = views_css_safe($id);
+      $object->class = drupal_clean_css_identifier(strtolower($id));
       $object->label = check_plain($view->field[$id]->label());
       $object->is_multiple = $field_is_multiple;       
       $rendered_fields[$id] = $object;      
diff -rupN ./views_datasource/views_xhtml.views.inc ./views_datasource_d7/views_xhtml.views.inc
--- ./views_datasource/views_xhtml.views.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_xhtml.views.inc	2011-02-24 22:36:58.000000000 -0800
@@ -9,6 +9,142 @@
  * @ingroup views_plugins
  */
 
+/**
+ * Implementation of views_plugin_style
+ *
+ * Comment: moved from views_plugin_style_xhtml.inc to allow recognition by Drupal, which
+ * expects the class to be declared in the same file as the style declaration at the end
+ * of this file (Hovhannes Tumanyan)
+ */
+class views_plugin_style_xhtml extends views_plugin_style {
+  /**
+   * Set default options
+   */
+  function option_definition() {
+    $options = parent::option_definition();
+    $options['format'] = array('default' => 'hcard', 'translatable' => FALSE);
+    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
+    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
+    /*$options['skip_empty_fields'] = array('default' => TRUE, 'translatable' => FALSE);*/
+    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
+    $options['content_type'] = array('default' => 'text/xhtml', 'translatable' => FALSE);
+    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
+    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
+    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
+    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
+    return $options;
+  }
+
+  /**
+   * Provide a form for setting options.
+   *
+   * @param $form
+   * @param $form_state
+   */
+  function options_form(&$form, &$form_state) {
+    $form['format'] = array(
+      '#type' => 'radios',
+      '#title' => ('Microformat'),
+      '#options' => array('hcard' => ('hCard'), 'hcalendar' => ('hCalendar')),
+      '#default_value' => $this->options['format'],
+    );
+   $form['field_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Field output',
+      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
+      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
+      '#default_value' => $this->options['field_output'],
+    );
+    $form['plaintext_output'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Plaintext output'),
+      '#default_value'  => $this->options['plaintext_output'],
+      '#description'    => ('For each row in the view, strip all markup from the field output.'),
+    );
+    /*
+    $form['skip_empty_fields'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Skip adding fields that are empty.'),
+      '#default_value'  => $this->options['skip_empty_fields'],
+      '#description'    => ('For each row in the view, skip adding a field if the field value is NULL or blank.'),
+    );*/    
+    $form['escape_as_CDATA']  = array(
+      '#type' => 'radios',
+      '#title' => 'Escape row content as CDATA',
+      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
+      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
+      '#default_value' => $this->options['escape_as_CDATA'],
+      //'#process' => array('views_process_dependency'),
+      //'#dependency' => array('edit-style-options-element-output-options' => array('nested')),
+    );
+    $form['header'] = array (
+      '#type' => 'textarea',
+      '#title' => 'XML document header',
+      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
+      '#default_value' => $this->options['header'], 
+      );
+    $form['content_type'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Content-Type'),
+      '#options'        => array(
+         'default'      => ("Default: text/xhtml"),  
+         'text/xml'     => 'text/xml',
+         'text/html'    => 'text/html',
+       ),
+      '#default_value'  => $this->options['content_type'],
+      '#description'    => ('The Content-Type header that will be sent with the XHTML output.')
+    );
+    $form['author'] = array (
+      '#type' => 'textfield',
+      '#title' => 'View author',
+      '#description' => 'The Drupal user name of the person who authored this view.',
+      '#default_value' => $this->options['author'], 
+      );     
+    $form['using_views_api_mode'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Views API mode'),
+      '#default_value'  => $this->options['using_views_api_mode'],
+      '#description'    => ('Not using View API mode means the JSON gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
+    );    
+  }
+
+  /**
+   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
+   * for the current style plugin
+   * @return array 
+   */
+  function theme_functions() {
+    $options = $this->options;
+    if ($options['format'] == 'hcard') $hook = 'views_views_xhtml_style_hcard';
+	  if ($options['format'] == 'hcalendar') $hook = 'views_views_xhtml_style_hcalendar'; 
+  	return views_theme_functions($hook, $this->view, $this->display);
+  }
+
+/**
+ * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
+ * @return array
+ */  
+  function additional_theme_functions() {
+  	return array();
+  }
+    
+  /**
+   * Implementation of view_style_plugin::render()
+   */
+  function render() {
+  	$view = $this->view;
+  	$options = $this->options;
+  	$field = $view->field;
+
+ 	  $rows = array();
+ 	 
+    foreach ($view->result as $row) {
+      $rows[] = _views_xhtml_render_fields($view, $row);
+    }
+
+      return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'rows' => $rows)); 	      
+ 	}  
+}
 
 /**
  * Implementation of hook_views_plugin().
@@ -16,7 +152,7 @@
 function views_xhtml_views_plugins() {
 	$path = drupal_get_path('module', 'views_xhtml');
   return array(
-    'module'  => views_xhtml,
+    'module'  => 'views_xhtml',
     'style'   => array(                 // declare the views_xhtml style plugin
       'views_xhtml' => array(
         'title'           => ('XHTML data document'),
diff -rupN ./views_datasource/views_xml.info ./views_datasource_d7/views_xml.info
--- ./views_datasource/views_xml.info	2010-07-15 22:10:12.000000000 -0700
+++ ./views_datasource_d7/views_xml.info	2011-02-24 22:36:58.000000000 -0800
@@ -2,12 +2,12 @@
 name = Views XML
 description = "Views style plugin to render node content as XML"
 package = Views
-core = 6.x
+core = 7.x
 dependencies[] = views
 php = 5.1
 ; Information added by drupal.org packaging script on 2010-07-16
-version = "6.x-1.0-beta2"
-core = "6.x"
+version = "7.x-dev"
+core = "7.x"
 project = "views_datasource"
 datestamp = "1279257012"
 
diff -rupN ./views_datasource/views_xml.module ./views_datasource_d7/views_xml.module
--- ./views_datasource/views_xml.module	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_xml.module	2011-02-24 22:36:58.000000000 -0800
@@ -152,7 +152,7 @@ function _views_xml_render_fields($view,
       $object->id = $id;
       $object->content = $field_output;
       $object->raw = $field_raw;
-      $object->class = views_css_safe($id);
+      $object->class = drupal_clean_css_identifier(strtolower($id));
       $object->label = check_plain($view->field[$id]->label());
       $object->is_multiple = $field_is_multiple;       
       $rendered_fields[$id] = $object;      
diff -rupN ./views_datasource/views_xml.views.inc ./views_datasource_d7/views_xml.views.inc
--- ./views_datasource/views_xml.views.inc	2010-07-15 00:34:48.000000000 -0700
+++ ./views_datasource_d7/views_xml.views.inc	2011-02-24 22:36:58.000000000 -0800
@@ -9,6 +9,181 @@
  * @ingroup views_plugins
  */
 
+/**
+ * Implementation of views_plugin_style
+ *
+ * Comment: moved from views_plugin_style_xhtml.inc to allow recognition by Drupal, which
+ * expects the class to be declared in the same file as the style declaration at the end
+ * of this file (Hovhannes Tumanyan)
+ */
+class views_plugin_style_xml extends views_plugin_style {
+
+  /** 
+   * Implementation of views_plugin_style::option_definition 
+   */ 
+	function option_definition() {
+		global $user;
+    $options = parent::option_definition();
+    $options['schema'] = array('default' => 'raw', 'translatable' => FALSE);
+    $options['root_element'] = array('default' => 'node', 'translatable' => FALSE);
+    $options['top_child_object'] = array('default' => 'node', 'translatable' => FALSE);
+    $options['field_output'] = array('default' => 'normal', 'translatable' => FALSE);
+    $options['plaintext_output'] = array('default' => TRUE, 'translatable' => FALSE);
+    /*$options['skip_empty_fields'] = array('default' => TRUE, 'translatable' => FALSE);*/
+    $options['element_output'] = array('default' => 'nested', 'translatable' => FALSE);
+    $options['escape_as_CDATA'] = array('default' => 'no', 'translatable' => FALSE);
+    $options['content_type'] = array('default' => 'text/xml', 'translatable' => FALSE);
+    $options['header'] = array('default' => NULL, 'translatable' => FALSE);
+    $options['author'] = array('default' => $user->name, 'translatable' => FALSE);
+    $options['using_views_api_mode'] = array('default' => FALSE, 'translatable' => FALSE);
+    //$options['action_on_missing_field'] = array('default' => 'none', 'translatable' => FALSE);
+    return $options;
+  }
+  
+  /**
+   * Provide a form for setting options.
+   *
+   * @param $form
+   * @param $form_state
+   */
+  function options_form(&$form, &$form_state) {
+  	$form['schema'] = array(
+      '#type' => 'radios',
+      '#title' => ('XML schema'),
+      '#description' => ('The schema or format of the XML data document.'),    
+      '#options' => array('raw' => ('Raw XML'), 'opml' => ('OPML'), 'atom' => ('Atom')),
+      '#default_value' => $this->options['schema'],
+    );
+    $form['root_element'] = array(
+      '#type' => 'textfield',
+      '#title' => ('Root element name'),
+      '#default_value' => $this->options['root_element'],
+      '#description' => ('The name of the root element in a raw XML document.'),
+      //'#process' => array('views_process_dependency'),
+      //'#dependency' => array('edit-style-options-schema' => array('raw')),  
+    );
+  	$form['top_child_object'] = array(
+    '#type' => 'textfield',
+    '#title' => ('Top-level child element name'),
+    '#default_value' => $this->options['top_child_object'],
+    '#description' => ('The name of each top-level child object in a raw XML document. e.g node or user or forum_post'),
+    );       
+   $form['field_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Field output',
+      '#description' => 'For each row in the view, fields can be output as either the field rendered by Views, or by the raw content of the field.',  
+      '#options' => array('normal' => ('Normal'), 'raw' => ('Raw')),
+      '#default_value' => $this->options['field_output'],
+    );
+    $form['plaintext_output'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Plaintext output'),
+      '#default_value'  => $this->options['plaintext_output'],
+      '#description'    => ('For each row in the view, strip all markup from the field output.'),
+    );
+    /*
+    $form['skip_empty_fields'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Skip adding fields that are empty.'),
+      '#default_value'  => $this->options['skip_empty_fields'],
+      '#description'    => ('For each row in the view, skip adding a field if the field value is NULL or blank.'),
+    );*/    
+    $form['element_output']  = array(
+      '#type' => 'radios',
+      '#title' => 'Element output',
+      '#description' => 'For each row in the view, fields can be output as either nested XML child elements, or attributes of the raw XML element.',
+      '#options' => array('nested' => ('Nested'), 'attributes' => ('Attributes')),
+      '#default_value' => $this->options['element_output'],
+    );
+    $form['escape_as_CDATA']  = array(
+      '#type' => 'radios',
+      '#title' => 'Escape row content as CDATA',
+      '#description' => 'For each row in the view, escape the row field content as XML CDATA sections.',
+      '#options' => array('yes' => ('Yes'), 'no' => ('No')),
+      '#default_value' => $this->options['escape_as_CDATA'],
+      //'#process' => array('views_process_dependency'),
+      //'#dependency' => array('edit-style-options-element-output-options' => array('nested')),
+    );
+    $form['header'] = array (
+      '#type' => 'textarea',
+      '#title' => 'XML document header',
+      '#description' => 'You can use this to place any additional lines you want after the document declaration (like !DOCTYPE.)',
+      '#default_value' => $this->options['header'], 
+      );
+    $form['content_type'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Content-Type'),
+      '#options'        => array(
+         'default'      => ("Default: text/xml for raw documents, text/html for OPML, application/atom+xml for Atom."),  
+         'text/xml'     => 'text/xml',
+         'text/html'    => 'text/html',
+         'text/x-opml'  => 'text/x-opml'
+         ),
+      '#default_value'  => $this->options['content_type'],
+      '#description'    => ('The Content-Type header that will be sent with the XML output.')
+    );
+    $form['author'] = array (
+      '#type' => 'textfield',
+      '#title' => 'View author',
+      '#description' => 'The Drupal user name of the person who authored this view.',
+      '#default_value' => $this->options['author'], 
+      );     
+    $form['using_views_api_mode'] = array(
+      '#type'           => 'checkbox',
+      '#title'          => ('Views API mode'),
+      '#default_value'  => $this->options['using_views_api_mode'],
+      '#description'    => ('Not using View API mode means the XML gets output directly and the server ceases normal page processing.  Using it means the server does not cease processing after outputting the JSON.  This allows the Views API to be used with the view without having to prematurely terminate page processing.'),
+    );
+    /*
+    $form['action_on_missing_field'] = array(
+      '#type'           => 'radios',
+      '#title'          => ('Action on missing field'),
+      '#options' => array('none' => ('Take no action if a required field is missing.'), 'warn' => ('Warn about the missing fields in preview mode.'), 'stop'=>t('Stop page processing and send an error message if a required field is missing.')),
+      '#default_value'  => $this->options['action_on_missing_field'],
+      '#description'    => ('Action to take if no field can be mapped to a required element or schema for the selected XML schema.'),
+    );*/      
+    
+  } 
+ 	
+  /**
+   * Implementation of views_style_plugin::theme_functions(). Returns an array of theme functions to use.
+   * for the current style plugin
+   * @return array 
+   */
+  function theme_functions() {
+    $options = $this->options;
+    if ($options['schema'] == 'raw') $hook = 'views_views_xml_style_raw';
+	  if ($options['schema'] == 'opml') $hook = 'views_views_xml_style_opml';
+	  if ($options['schema'] == 'atom') $hook = 'views_views_xml_style_atom'; 
+  	return views_theme_functions($hook, $this->view, $this->display);
+  }
+
+/**
+ * Implementation of views_style_plugin::additional_theme_functions(). Returns empty array.
+ * @return array
+ */  
+  function additional_theme_functions() {
+  	return array();
+  }
+  
+  /**
+   * Implementation of view_style_plugin::render()
+   */
+  function render() {
+  	$view = $this->view;
+  	$options = $this->options;
+  	$field = $view->field;
+  	
+ 	  $rows = array();
+    
+ 	  foreach ($view->result as $row) {    	      
+    	$rows[] = _views_xml_render_fields($view, $row);        
+    }
+    
+    return theme($this->theme_functions(), array('view' => $this->view, 'options' => $this->options, 'rows' => $rows));
+ 	}
+ 
+}
 
 /**
  * Implementation of hook_views_plugin().
