-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathlang_XMLasText.html
63 lines (52 loc) · 1.86 KB
/
lang_XMLasText.html
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
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Language DB Possession </title>
<script>
function loadDoc() {
//alert("Send Request");
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var allLanguages=this.responseText;
var language2find="Bororo";
var language2find="Plains Cree";
var language2find="Turkish";
var language2find=(new URL(document.URL)).searchParams.get("lang")
var findLangID='<LangID>'+ language2find + '</LangID>';
var posOfLangID = allLanguages.indexOf(findLangID);
var startOfLangElement=allLanguages.slice(0,posOfLangID).lastIndexOf('<Language id=');
var endOfLangElement=allLanguages.indexOf('</Language>',posOfLangID);
var testLang1=allLanguages.slice(startOfLangElement,endOfLangElement+'</Language>'.length);
if(testLang1.length>100){
var replLTGT=testLang1.replace(/</g,'<').replace(/>/g,'>');
}
else{
var replLTGT="Language not found by ID";
}
document.getElementById("xml_pre").innerHTML =replLTGT;
document.getElementById("langID").innerHTML="XML Data for the language: "+findLangID;
}
};
xhttp.open("GET", "DB/Database_merged.xml", true);
//xhttp.open("GET", "ajax_info.txt", true);
xhttp.send();
}
</script>
</head>
<body onload="loadDoc();">
<header style="text-align: center;">
<h1 id='langID' style="font-size:200%;"> XML Data for the languag: </h1>
<h2 style="font-size:100%; font-weight:bold">Adnominal possession: morphosyntactic strategies in the languages of the world</h2>
</header>
<hr>
<div>
<pre id="xml_pre">
Language XML Data will be Here!
</pre>
</div>
<hr>
<footer style="text-align: center;">2018 Karvovskaya Lena, <a href="https://orcid.org/0000-0001-7777-5603" target="_blank">ORCID</a></footer>
</body>
</html>