[seed] xml: Implement node.getElementsByTagName



commit 8185b18125b663a67ec7b345c5c7de2de27144d1
Author: Robert Carr <racarr svn gnome org>
Date:   Tue May 12 15:12:15 2009 -0400

    xml: Implement node.getElementsByTagName
---
 modules/libxml/xml.js |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diff --git a/modules/libxml/xml.js b/modules/libxml/xml.js
index 2e602e4..cf1b6ed 100644
--- a/modules/libxml/xml.js
+++ b/modules/libxml/xml.js
@@ -1 +1,12 @@
-Seed.print("XML!");
+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;
+}



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]