mirror of
https://github.com/yacy/yacy_search_server.git
synced 2024-09-24 00:00:19 +02:00
28971da91c
git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@3074 6c8d7289-2bf4-0310-a012-ef5d649a1542
53 lines
1.1 KiB
JavaScript
53 lines
1.1 KiB
JavaScript
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;
|
|
} |