[gnomeweb-wp] make all the website to be application/xhtml+xml, since xml2po output is xml.



commit 9d29af466c1ea13d1fcf659a85fb90efb5d596ab
Author: Vinicius Depizzol <vdepizzol gmail com>
Date:   Thu Feb 10 23:50:40 2011 -0200

    make all the website to be application/xhtml+xml, since xml2po output is xml.
    
    xhtml.xsl hack is there to allow old browsers to render xhtml as html.

 wp-content/plugins/wppo/wppo.php         |    7 +++++++
 wp-content/themes/gnome-grass/header.php |    2 ++
 wp-content/themes/gnome-grass/xhtml.xsl  |    6 ++++++
 3 files changed, 15 insertions(+), 0 deletions(-)
---
diff --git a/wp-content/plugins/wppo/wppo.php b/wp-content/plugins/wppo/wppo.php
index 6376063..4dd7d8b 100644
--- a/wp-content/plugins/wppo/wppo.php
+++ b/wp-content/plugins/wppo/wppo.php
@@ -40,6 +40,13 @@ bindtextdomain ('gnomesite', PO_DIR);
 bind_textdomain_codeset ('gnomesite', 'UTF-8');
 textdomain ('gnomesite');
 
+/* Forces to use XHTML Doctype, since output from xml2po is xml */
+function wppo_html_type () {
+  return 'application/xhtml+xml';
+}
+add_filter('pre_option_html_type', 'wppo_html_type');
+header("Content-Type: application/xhtml+xml; charset=utf-8");
+
 /* Creates wppo auxiliary table when plugin is installed to keep all the
  * translated xml in an easy accessible format.
  */
diff --git a/wp-content/themes/gnome-grass/header.php b/wp-content/themes/gnome-grass/header.php
index 781fae8..3e002c0 100644
--- a/wp-content/themes/gnome-grass/header.php
+++ b/wp-content/themes/gnome-grass/header.php
@@ -1,3 +1,5 @@
+<?php echo '<?xml version="1.0" encoding="utf-8"?>'."\n";?>
+<?php echo '<?xml-stylesheet type="text/xsl" href="' . get_bloginfo('stylesheet_directory') . '/xhtml.xsl"?>'."\n";?>
 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";>
 <html xmlns="http://www.w3.org/1999/xhtml"; xml:lang="en" lang="en">
 
diff --git a/wp-content/themes/gnome-grass/xhtml.xsl b/wp-content/themes/gnome-grass/xhtml.xsl
new file mode 100644
index 0000000..e8e6e12
--- /dev/null
+++ b/wp-content/themes/gnome-grass/xhtml.xsl
@@ -0,0 +1,6 @@
+<stylesheet version="1.0"
+     xmlns="http://www.w3.org/1999/XSL/Transform";>
+    <template match="/">
+        <copy-of select="."/>
+    </template>
+</stylesheet>



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]