diff --git a/modules/xerte/play_html5.php b/modules/xerte/play_html5.php
index ebdaef75be..c248944700 100644
--- a/modules/xerte/play_html5.php
+++ b/modules/xerte/play_html5.php
@@ -6,14 +6,19 @@
// Version 1.0 University of Nottingham
// (pl)
// Set up the preview window for a xerte piece
-
+require(dirname(__FILE__) . '/../../website_code/php/xmlInspector.php');
function show_template($row_play){
global $xerte_toolkits_site;
- $string_for_flash_xml = $xerte_toolkits_site->users_file_area_short . $row_play['template_id'] . "-" . $row_play['username'] . "-" . $row_play['template_name'] . "/data.xml?time=" . time();
-
$string_for_flash = $xerte_toolkits_site-> users_file_area_short . $row_play['template_id'] . "-" . $row_play['username'] . "-" . $row_play['template_name'] . "/";
-
+
+ $xmlfile = $string_for_flash . "data.xml";
+
+ $xmlFixer = new XerteXMLInspector();
+ $xmlFixer->loadTemplateXML($xmlfile);
+
+ $string_for_flash_xml = $xmlfile . "?time=" . time();
+
$template_path_string = "modules/xerte/parent_templates/" . $row_play['template_name'];
list($x, $y) = explode("~",get_template_screen_size($row_play['template_name'],$row_play['template_framework']));
diff --git a/modules/xerte/preview_html5.php b/modules/xerte/preview_html5.php
index e03e0b869c..fc66af61a5 100644
--- a/modules/xerte/preview_html5.php
+++ b/modules/xerte/preview_html5.php
@@ -20,12 +20,19 @@
* @version 1.0
* @author Patrick Lockley
*/
-
+require(dirname(__FILE__) . '/../../website_code/php/xmlInspector.php');
function show_preview_code($row, $row_username){
global $xerte_toolkits_site;
- $string_for_flash_xml = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row_username['username'] . "-" . $row['template_name'] . "/preview.xml" . "?time=" . time();
+ $string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row_username['username'] . "-" . $row['template_name'] . "/";
+
+ $xmlfile = $string_for_flash . "preview.xml";
+
+ $xmlFixer = new XerteXMLInspector();
+ $xmlFixer->loadTemplateXML($xmlfile);
+
+ $string_for_flash_xml = $xmlfile . "?time=" . time();
$string_for_flash = $xerte_toolkits_site->users_file_area_short . $row['template_id'] . "-" . $row_username['username'] . "-" . $row['template_name'] . "/";