xml functions in xml.js

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@1751 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
allo 19 years ago
parent 05be9264a3
commit bb22bfed89

@ -1,4 +1,4 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
, da<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" "http://www.w3.org/TR/REC-html40/loose.dtd">
<html>
<head>
<title>YaCy '#[clientname]#': Network Overview</title>

@ -4,6 +4,7 @@
<title>YaCy Watch Crawler</title>
#%env/templates/metas.template%#
<script src="/js/ajax.js"></script>
<script src="/js/xml.js"></script>
<script src="/js/WatchCrawler.js"></script>
</head>
<body marginheight="0" marginwidth="0" leftmargin="0" topmargin="0">

@ -6,6 +6,7 @@
<link rel="alternate" type="application/rss+xml" title="Search for #[former]#" href="index.rss?search=#[former]#">
<script src="/js/ajax.js"></script>
<script src="/js/xml.js"></script>
<script src="/js/Index.js"></script>
</head>

@ -30,8 +30,9 @@ function handleState(req) {
var urlHash = response.getElementsByTagName("urlHash")[0].firstChild.data;
var status = response.getElementsByTagName("status")[0].firstChild.data;
var span = document.getElementById(urlHash)
if (span.hasChildNodes()) span.removeChild(span.firstChild);
var span = document.getElementById(urlHash)
removeAllChildren(span);
//span.removeChild(span.firstChild);
if (status < 11) {
span.className = "snippetLoaded";

@ -139,13 +139,7 @@ function handleQueues(){
createRemoteCrawlerTable(remotecrawlerqueue);
}
}
function removeAllChildren(element){
child=element.firstChild;
while(child!=null){
element.removeChild(child);
child=element.firstChild;
}
}
function clearTable(table, numSkip){
if(numSkip==null){
numSkip=0;
@ -285,49 +279,6 @@ function createRemoteCrawlerTable(remotecrawlerqueue){
dark=!dark;
}
}
function getValue(element){
if(element == null){
return "";
}else if(element.nodeType == 3){ //Textnode
return element.nodeValue;
}else if(element.firstChild != null && element.firstChild.nodeType == 3){
return element.firstChild.nodeValue;
}
return "";
}
function getFirstChild(element, childname){
if(childname==null){
childname="";
}
if(element == null){
return null;
}
child=element.firstChild;
while(child != null){
if(child.nodeType!=3 && (child.nodeName.toLowerCase()==childname.toLowerCase() || childname=="")){
return child;
}
child=child.nextSibling;
}
return null;
}
function getNextSibling(element, childname){
if(childname==null){
childname="";
}
if(element == null){
return null;
}
child=element.nextSibling;
while(child != null){
if(child.nodeType==1 && (child.nodeName.toLowerCase()==childname.toLowerCase() || childname=="")){
return child;
}
child=child.nextSibling;
}
return null;
}
function createCol(content){
col=document.createElement("td");

@ -0,0 +1,53 @@
function removeAllChildren(element){
if(element==null){
return;
}
child=element.firstChild;
while(child!=null){
element.removeChild(child);
child=element.firstChild;
}
}
function getValue(element){
if(element == null){
return "";
}else if(element.nodeType == 3){ //Textnode
return element.nodeValue;
}else if(element.firstChild != null && element.firstChild.nodeType == 3){
return element.firstChild.nodeValue;
}
return "";
}
function getFirstChild(element, childname){
if(childname==null){
childname="";
}
if(element == null){
return null;
}
child=element.firstChild;
while(child != null){
if(child.nodeType!=3 && (child.nodeName.toLowerCase()==childname.toLowerCase() || childname=="")){
return child;
}
child=child.nextSibling;
}
return null;
}
function getNextSibling(element, childname){
if(childname==null){
childname="";
}
if(element == null){
return null;
}
child=element.nextSibling;
while(child != null){
if(child.nodeType==1 && (child.nodeName.toLowerCase()==childname.toLowerCase() || childname=="")){
return child;
}
child=child.nextSibling;
}
return null;
}
Loading…
Cancel
Save