Fix problem with apostrophes in javascript popup texts
The XML data files includes apostrophes. When those files were read in, those were escaped to html entities. Those entities were then rendered by the browser into literal apostrophes on the page. In the case of texts that ended up as strings in javascript variables for display on mouseover, the html entity appeared as a literal string. With Mike's help, figured out the solution to the problem, which was to add another boolean to the def_xml_transform function telling that function whether to treat the output as going to HTML or not (i.e. for javascript), and then modify the call to that function from the ajax_search.php page to pass a value of false for treatAsHtml.
in xmldb.php
function def_xml_transform($xml, $stylesheet, $params = false)
becomes
function def_xml_transform($xml, $stylesheet, $params = false, $asHTML = true)
and
return $xml_result->saveHTML();
becomes
if ($asHTML) {
return $xml_result->saveHTML();
}
else {
return $xml_result;
}
in ajax_search.php
$xml_result = def_xml_transform('<root>' . $xml_result . '', '../xslt/ajax_search.xsl');
becomes
$xml_result = def_xml_transform('<root>' . $xml_result . '', '../xslt/ajax_search.xsl',false,false);