This file is indexed.

/usr/share/doc/libjs-xmlextras/examples/demo.html is in libjs-xmlextras 20060529-1.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>Xml Extras Demo</title>
<style type="text/css">

html, body {
	border:		0;
}

body {
	background: ButtonFace;
	font:		MessageBox;
	font:		Message-Box;
}

form {
	padding:	0;
	margin:		0;
}

fieldset fieldset {
	margin:	5px;
}

button {
	margin-left:	5px;
}

textarea {
	width:	100%;
	height:	200px;
}

#out {
	background:		White;
	color:			Black;
	border:			1px Solid ThreeDDarkShadow;
	padding:		3px;
	margin-top:		5px;
	font-family:	Verdana;
}

#srcTextContainer {
	display:	none;
}
</style>
<style type="text/css">



.element {
	color:			blue;
	padding-left:	16px;
}

.elementname {
	color:	DarkRed;	
}

.attribname {
	color:	red;
}

.attribvalue {
	color:	blue;
}

.text {
	color:			WindowText;
	padding-left:	16px;
}

.cdata-content {
	color:			WindowText;
	font-family:	Courier New;
	white-space:	pre;
	display:		block;
	border-left:	1px solid Gray;
	padding-left:	16px;
}

.comment {
	color:			blue;
	padding-left:	16px;
}

.doctype {
	color:			blue;
	padding-left:	16px;
}

.comment-content {
	white-space:	pre;
	font-family:	Courier New;
	color:			Gray;
	display:		block;
}

</style>
<script type="text/javascript" src="xmlextras.js"></script>
<script type="text/javascript">
//<![CDATA[

var progressText = "Loading...";

function loadXmlFile(sUri, bAsync, sOutFormat) {
	var done = function () {
		try {
			switch (sOutFormat) {
				case "plainText":
					document.getElementById("out").innerHTML = stripHtml(xmlHttp.responseText);
					break;
				case "xmlText":
					document.getElementById("out").innerHTML = stripHtml(xmlHttp.responseXML.xml);
					break;
				case "xmlTree":
					document.getElementById("out").innerHTML = createXmlTree(xmlHttp.responseXML, 0);
					break;
			}
		}
		catch (exc) {
			document.getElementById("out").innerHTML = "An error occured <br/>" +
				"Message: " + exc.message + "<br/>" +
				"File: " + exc.fileName + "<br/>" +
				"Line: " + exc.lineNumber + "<br/>" +
				"Name: " + exc.name;
		}
	};
	
	var xmlHttp = XmlHttp.create();
	xmlHttp.open("GET", sUri, bAsync);
	if (bAsync) {
		xmlHttp.onreadystatechange = function () {
			if (xmlHttp.readyState == 4)
				done();
		}
		document.getElementById("out").innerHTML = progressText;
	}
	xmlHttp.send(null);
	if (!bAsync) {
		done();
	}
}

function loadXmlText(sText, sOutFormat) {
	var xmlDoc = XmlDocument.create();
	xmlDoc.loadXML(sText);
	try {
		switch (sOutFormat) {
			case "plainText":
				document.getElementById("out").innerHTML = "Not valid for XmlDocument";
				break;
			case "xmlText":
				document.getElementById("out").innerHTML = stripHtml(xmlDoc.xml);
				break;
			case "xmlTree":
				document.getElementById("out").innerHTML = createXmlTree(xmlDoc, 0);
				break;
		}
	}
	catch (exc) {
		document.getElementById("out").innerHTML = "An error occured <br/>" +
			exc.message;
	}
}

// this function takes an xml node and returns an html string that displays that node
// the indent argument is used to describe what depth the node is at so that
// the html code can create a nice indention
function createXmlTree(node, indent) {

	if (node == null)
		return "";
	var str = "";
	
	switch (node.nodeType) {
		case 1:	// Element
			str += "<div class='element'>&lt;<span class='elementname'>" + node.nodeName + "</span>";
			
			var attrs = node.attributes;
			for (var i = 0; i < attrs.length; i++)
				str += createXmlAttribute(attrs[i]);
			
			if (!node.hasChildNodes())
				return str + "/&gt;</div>";
			
			str += "&gt;<br />";
			
			var cs = node.childNodes;
			for (var i = 0; i < cs.length; i++)
				str += createXmlTree(cs[i], indent + 3);
			
			str += "&lt;/<span class='elementname'>" + node.nodeName + "</span>&gt;</div>";
			break;
	
		case 9:	// Document
			var cs = node.childNodes;
			for (var i = 0; i < cs.length; i++)
				str += createXmlTree(cs[i], indent);
			break;
	
		case 3:	// Text
			if (!/^\s*$/.test(node.nodeValue))
				str += "<span class='text'>" + node.nodeValue + "</span><br />";
			break;
	
		case 7:	// ProcessInstruction
			str += "&lt;?" + node.nodeName;
		
			var attrs = node.attributes;
			for (var i = 0; i < attrs.length; i++)
				str += createXmlAttribute(attrs[i]);
			
			str+= "?&gt;<br />"
			break;
	
		case 4:	// CDATA
			str = "<div class='cdata'>&lt;![CDATA[<span class='cdata-content'>" + 
				node.nodeValue +
			"</span>]" + "]></div>";
			break;
			
		case 8:	// Comment
			str = "<div class='comment'>&lt;!--<span class='comment-content'>" + 
				node.nodeValue +
			"</span>--></div>";
			break;
		
		case 10:
				str = "<div class='doctype'>&lt;!DOCTYPE " + node.name;
				if (node.publicId) {
					str += " PUBLIC \"" + node.publicId + "\"";
					if (node.systemId) 
						str += " \"" + node.systemId + "\"";
				}
				else if (node.systemId) {
					str += " SYSTEM \"" + node.systemId + "\"";
				}
				str += "&gt;</div>";
				
				// TODO: Handle custom DOCTYPE declarations (ELEMENT, ATTRIBUTE, ENTITY)
				
				break;
		
		default:
			//alert(node.nodeType + "\n" + node.nodeValue);
			inspect(node);
	}
	
	return str;
}

function createXmlAttribute(a) {
	return " <span class='attribname'>" + a.nodeName + "</span><span class='attribvalue'>=\"" + a.nodeValue + "\"</span>";
}

function stripHtml(s) {
	return s.replace(/\&/g, "&amp;").replace(/\</g, "&lt;").replace(/\>/g, "&gt;").replace(/\t/g, "&nbsp;&nbsp;&nbsp;").replace(/\n/g, "<br />");
}

function alertXml(src) {
	var xmlHttp = XmlHttp.create();
	xmlHttp.open("GET", src, false);
	xmlHttp.send(null);
	alert(xmlHttp.responseXML.xml);
}

function doLoad() {
	var f = document.getElementById("xmlForm");
	var bAsync = f.async[1].checked;
	var select = document.getElementById("src");
	var value = select.value;
	
	if (value == "url") {
		var sUri = select.options[select.selectedIndex].text;

		if (f.outFormat[0].checked)
			loadXmlFile(sUri, bAsync, "plainText");
		else if (f.outFormat[1].checked)
			loadXmlFile(sUri, bAsync, "xmlText");
		if (f.outFormat[2].checked)
			loadXmlFile(sUri, bAsync, "xmlTree");
	}
	else {
		var sText = document.getElementById("srcText").value;

		if (f.outFormat[0].checked)
			loadXmlText(sText, "plainText");
		else if (f.outFormat[1].checked)
			loadXmlText(sText, "xmlText");
		if (f.outFormat[2].checked)
			loadXmlText(sText, "xmlTree");
	}
}

function inspect(obj) {
	var str = "";
	for (var k in obj)
		str += "obj." + k + " = " + obj[k] + "\n";
	window.alert(str);
}

function updateSrcUI() {
	var value = document.getElementById("src").value;
	var srcTextContainer = document.getElementById("srcTextContainer");
	
	srcTextContainer.style.display = value == "text" ? "block" : "none";
}

//]]>
</script>
</head>
<body>

<form id="xmlForm" onsubmit="return false" action="">
<fieldset>
<legend>Source</legend>

<select id="src" onchange="updateSrcUI()">
	<option value="url">tree.xml</option>
	<option value="url">marquee-binding.xml</option>
	<option value="url">buddy.xml</option>
	<option value="url">demo.html</option>
	<option value="text">Input text...</option>
</select>

<button onclick="doLoad()">Load</button>

<div id="srcTextContainer">
	<label for="srcText">XML Source Text:</label> <br/>
	<textarea id="srcText" rows="" cols=""></textarea>
</div>

</fieldset>

<fieldset>
<legend>Options</legend>

<fieldset>
<legend>Load Style</legend>
<label for="async0"><input type="radio" id="async0" name="async" value="sync" /> Synchronous</label><br/>
<label for="async1"><input type="radio" name="async"  id="async1" value="async" checked="checked" /> Asynchronous</label>
</fieldset>

<fieldset>
<legend>Output format</legend>
<label for="outFormat0"><input type="radio" name="outFormat" id="outFormat0" value="plainText" /> Plain Text</label><br/>
<label for="outFormat1"><input type="radio" name="outFormat" id="outFormat1" value="xmlText" /> XML Text</label><br/>
<label for="outFormat2"><input type="radio" name="outFormat" id="outFormat2" value="xmlTree" checked="checked" /> XML Tree</label>
</fieldset>

</fieldset>

</form>

<div id="out">&nbsp;</div>


</body>
</html>