blob: ffdfeb696425970777dc99cf99d0ab82283c1c90 [file] [log] [blame]
Leo Repp58b9f112021-11-22 11:57:47 +01001var getChildren = exports.getChildren = function(elem){
2 return elem.children;
3};
4
5var getParent = exports.getParent = function(elem){
6 return elem.parent;
7};
8
9exports.getSiblings = function(elem){
10 var parent = getParent(elem);
11 return parent ? getChildren(parent) : [elem];
12};
13
14exports.getAttributeValue = function(elem, name){
15 return elem.attribs && elem.attribs[name];
16};
17
18exports.hasAttrib = function(elem, name){
19 return !!elem.attribs && hasOwnProperty.call(elem.attribs, name);
20};
21
22exports.getName = function(elem){
23 return elem.name;
24};