28
32
$out = fopen("php://output", "w");
32
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
33
echo "<result><Error>$error</Error></result>";
39
fwrite($out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
40
fwrite($out, "<result>");
41
if ($error) fwrite($out, "<Error>$error</Error>");
37
fwrite($out, "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n");
38
fwrite($out, "<result>");
40
fwrite($out, "<Error>$error</Error>");
43
43
foreach ($res as &$mod) {
44
44
if ($mod['title']) {
45
45
$title = xml_escape($mod['title']);
52
52
fwrite($out, $mod['description']);
53
53
fwrite($out, "</description>");
55
fwrite($out, "<results>");
56
foreach ($mod['results'] as &$r) {
57
$rreq = new REQUEST($r['props']);
58
$props = xml_escape($rreq->GetQueryString());
60
$title = xml_escape($r['title']);
62
$title = preg_replace("/&/", ",", $props);
55
if ($mod['results']) {
56
fwrite($out, "<results>");
57
foreach ($mod['results'] as &$r) {
58
$rreq = new REQUEST($r['props']);
59
$props = xml_escape($rreq->GetQueryString());
61
$title = xml_escape($r['title']);
63
$title = preg_replace("/&/", ",", $props);
66
if ($r['certain']) $extra=" certain=\"1\"";
68
fwrite($out, "<Value title=\"$title\" props=\"$props\"$extra>");
69
if ($r['description']) {
70
fwrite($out, "<description>");
71
fwrite($out, $r['description']);
72
fwrite($out, "</description>");
74
fwrite($out, "</Value>");
67
if ($r['certain']) $extra=" certain=\"1\"";
69
fwrite($out, "<Value title=\"$title\" props=\"$props\"$extra>");
70
if ($r['description']) {
71
fwrite($out, "<description>");
72
fwrite($out, $r['description']);
73
fwrite($out, "</description>");
75
fwrite($out, "</Value>");
77
fwrite($out, "</results>");
78
} else if ($mod['content']) {
79
fwrite($out, "<Content>");
80
fwrite($out, $mod['content']);
81
fwrite($out, "</Content>");
76
fwrite($out, "</results></module>");
79
fwrite ($out, "</result>");
83
fwrite($out, "</module>");
86
fwrite ($out, "</result>");
89
if (($xslt)&&(!$error)) {
91
echo $ADEI->TransformXML($xslt, $temp_file);
92
} catch (ADEIException $ex) {
93
$ex->logInfo(NULL, $reader?$reader:$req);
94
$error = $ADEI->EscapeForXML($ex->getInfo());
100
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n";
101
echo "<result><Error>$error</Error></result>";
b'\\ No newline at end of file'