File: xml.js

package info (click to toggle)
seed 3.2.0-2
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 5,900 kB
  • sloc: ansic: 24,336; sh: 11,196; makefile: 773; xml: 187; python: 173
file content (22 lines) | stat: -rw-r--r-- 461 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
xml = imports.libxml;

xml._nodeProto.getElementsByTagName = function(name){
    ret = [];
    child = this.children;
    while (child){
	if (child.name == name)
	    ret.push (child);
	child = child.next;
    }
    return ret;
}

xml._nodeProto.getAttribute = function(name){
    properties = this.properties;
    while (properties){
	if (properties.name == name)
	    return properties.children.content;
	properties = properties.next
    }
    return null;
}