From 005b483487e4e79c47bb78448c7232a5f356ea19 Mon Sep 17 00:00:00 2001 From: Nathan Gray Date: Thu, 25 Aug 2011 15:46:54 +0000 Subject: [PATCH] Replace extra XML declaration --- etemplate/inc/class.bo_merge.inc.php | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.bo_merge.inc.php b/etemplate/inc/class.bo_merge.inc.php index f94cedd9b4..7073c00d6a 100644 --- a/etemplate/inc/class.bo_merge.inc.php +++ b/etemplate/inc/class.bo_merge.inc.php @@ -348,7 +348,6 @@ abstract class bo_merge { $mso_application_progid = ''; } - // Tags we can replace with the target document's version $replace_tags = array(); switch($mimetype.$mso_application_progid) @@ -402,6 +401,15 @@ abstract class bo_merge { $element = new SimpleXMLelement($content); $content = $xslt->transformToXml($element); + + // Word 2003 needs invalid XML, add back in + if($mimetype == 'application/xml' && $mso_application_progid == 'Word.Document') { + $content = ''.$content; + } + // Validate + $doc = new DOMDocument(); +// $doc->loadXML($content); +// $doc->schemaValidate('/home/nathan/Downloads/WordprocessingML Schemas/wordnet.xsd'); //echo $content;die(); } catch (Exception $e)