Index: modules/export_docbook/export_docbook.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/export_docbook/export_docbook.module,v retrieving revision 1.4 diff -u -r1.4 export_docbook.module --- modules/export_docbook/export_docbook.module 30 Nov 2005 17:45:28 -0000 1.4 +++ modules/export_docbook/export_docbook.module 2 Nov 2006 21:03:58 -0000 @@ -1,5 +1,5 @@ True, 'Output-Xhtml' => True, 'Wrap' => 80); - foreach ($config as $key => $value) { - tidy_setopt($key,$value); - } - tidy_parse_string($html); - tidy_clean_repair(); - $content = tidy_get_output(); + $tidy = new tidy; + $tidy->parseString($html, $config, 'utf8'); + $tidy->cleanRepair(); + $content = $tidy; $newdom = new DOMDocument('1.0'); @@ -153,29 +150,30 @@ // grab the XSL stylesheet from the node where it's stored // and initialize the XSLT processor - $xsl = new DOMDocument(); + $xsl = new DOMDocument('1.0', 'iso-8859-1'); try { - $xsl->load('misc/h2db.xsl'); + $xsl->load(drupal_get_path('module', 'export_docbook').'/h2db.xsl'); } catch (DOMException $e) { echo '
';
       print_r ($e);
       echo '
'; } - $xsltproc = new XSLTProcessor(); - $xsltproc->importStylesheet($xsl); // make a new input DOM document - $inputdoc = new DOMDocument(); - if (!$inputdoc->loadXML($content)) { + $xml = new DOMDocument('1.0', 'iso-8859-1'); + if (!$xml->loadXML($content)) { drupal_set_message(t("There was an error while parsing the content as XML\n")); } + $xsltproc = new XSLTProcessor(); + $xsltproc->importStylesheet($xsl); + // Strip out XML directives $content = preg_replace('/<\?xml version=.*\?>\s*/i', '', $content); // Perform the XSLT transformation - $content = $xsltproc->transformToXML($inputdoc); + $content = $xsltproc->transformToXML($xml); // Strip out XML directives $content = preg_replace('/<\?xml version=.*\?>\s*/i', '', $content); @@ -269,6 +267,4 @@ if (arg(0) == 'node' && is_numeric(arg(1)) && arg(2) == 'outline') { return t('The outline feature allows you to include posts in the book hierarchy.', array('%book' => url('book'))); } -} - -?> +} \ No newline at end of file