Changeset 21008
- Timestamp:
- 10/09/08 00:24:16 (3 months ago)
- Location:
- lang/cplusplus/llv8call/trunk
- Files:
-
- 2 modified
-
ext/libxml/element.cc (modified) (3 diffs)
-
t/070_libxml/02_dom.js (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/cplusplus/llv8call/trunk/ext/libxml/element.cc
r21003 r21008 63 63 END 64 64 65 FUNCTION(removeAttribute) 66 ARG_COUNT(1); 67 ARG_str(name, 0); 68 EXTERNAL_NODE(); 69 xmlAttrPtr attr = domGetAttrNode(node, (const xmlChar*)*name); 70 if (attr) { 71 xmlUnlinkNode((xmlNodePtr)attr); 72 } 73 return Undefined(); 74 END 75 65 76 FUNCTION(setAttributeNode) 66 77 ARG_COUNT(1); … … 98 109 BIND_IM("getAttribute", getAttribute); 99 110 BIND_IM("hasAttribute", hasAttribute); 111 BIND_IM("removeAttribute", removeAttribute); 100 112 setupNodeIM(OBJECT_TEMPLATE); 101 113 EXPORT_CLASS("Element"); 102 114 ENDSUBMODULE 103 115 104 // REST: 6/24116 // REST: 7/24 105 117 // TODO: elem.setAttribute 106 118 // TODO: elem.setAttributeNS … … 108 120 // TODO: elem.getAttributeNode 109 121 // TODO: elem.getAttributeNodeNS 110 // TODO: elem.removeAttribute111 122 // TODO: elem.removeAttributeNS 112 123 // TODO: elem.hasAttributeNS -
lang/cplusplus/llv8call/trunk/t/070_libxml/02_dom.js
r21007 r21008 1 1 require('t/util.js'); 2 2 3 plan({tests:3 7});3 plan({tests:39}); 4 4 5 5 check_lib("org.coderepos.libxml"); … … 147 147 }); 148 148 149 test(function () { 150 root.setAttributeNode(doc.createAttribute("foo", "bar")); 151 is(root.toString(), '<foo foo="bar"/>', 'doc.createAttribute()'); 152 root.removeAttribute("foo"); 153 is(root.toString(), '<foo/>', 'doc.createAttribute()'); 154 }); 155 149 156 doc.close(); 150 157
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)