|
|
| version 1.13, 2001/10/19 14:42:53 | version 1.18, 2001/11/05 11:46:22 |
|---|---|
| Line 2 | Line 2 |
| Parser: @b dom parser class. | Parser: @b dom parser class. |
| Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexander Petrosyan <paf@design.ru> (http://design.ru/paf) | Author: Alexander Petrosyan <paf@design.ru> (http://paf.design.ru) |
| $Id$ | $Id$ |
| */ | */ |
| Line 70 static void _insertBefore(Request& r, co | Line 70 static void _insertBefore(Request& r, co |
| try { | try { |
| if(XalanNode *retNode=selfNode.insertBefore(&newChild, &refChild)) { | if(XalanNode *retNode=selfNode.insertBefore(&newChild, &refChild)) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, retNode); | VXnode& result=*new(pool) VXnode(pool, retNode, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 90 static void _replaceChild(Request& r, co | Line 90 static void _replaceChild(Request& r, co |
| try { | try { |
| if(XalanNode *retNode=selfNode.replaceChild(&newChild, &refChild)) { | if(XalanNode *retNode=selfNode.replaceChild(&newChild, &refChild)) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, retNode); | VXnode& result=*new(pool) VXnode(pool, retNode, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 109 static void _removeChild(Request& r, con | Line 109 static void _removeChild(Request& r, con |
| try { | try { |
| if(XalanNode *retNode=selfNode.removeChild(&oldChild)) { | if(XalanNode *retNode=selfNode.removeChild(&oldChild)) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, retNode); | VXnode& result=*new(pool) VXnode(pool, retNode, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 128 static void _appendChild(Request& r, con | Line 128 static void _appendChild(Request& r, con |
| try { | try { |
| if(XalanNode *retNode=selfNode.appendChild(&newChild)) { | if(XalanNode *retNode=selfNode.appendChild(&newChild)) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, retNode); | VXnode& result=*new(pool) VXnode(pool, retNode, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 149 static void _hasChildNodes(Request& r, c | Line 149 static void _hasChildNodes(Request& r, c |
| } | } |
| // Node cloneNode(in boolean deep); | // Node cloneNode(in boolean deep); |
| /// @test 1. who frees it up? 2. ownerDocument=? | /// @test ownerDocument=? |
| static void _cloneNode(Request& r, const String& method_name, MethodParams *params) { | static void _cloneNode(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXnode& vnode=*static_cast<VXnode *>(r.self); | VXnode& vnode=*static_cast<VXnode *>(r.self); |
| Line 158 static void _cloneNode(Request& r, const | Line 158 static void _cloneNode(Request& r, const |
| bool deep=params->as_bool(0, "deep must be bool", r); | bool deep=params->as_bool(0, "deep must be bool", r); |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, node.cloneNode(deep)); | VXnode& result=*new(pool) VXnode(pool, node.cloneNode(deep), true/*all sense goes here*/); |
| result.set_name(method_name); | result.set_name(method_name); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| Line 201 static void _setAttribute(Request& r, co | Line 201 static void _setAttribute(Request& r, co |
| *pool.transcode(name), | *pool.transcode(name), |
| *pool.transcode(attribute_value)); | *pool.transcode(attribute_value)); |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 214 static void _removeAttribute(Request& r, | Line 214 static void _removeAttribute(Request& r, |
| try { | try { |
| element.removeAttribute(*pool.transcode(name)); | element.removeAttribute(*pool.transcode(name)); |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 226 static void _getAttributeNode(Request& r | Line 226 static void _getAttributeNode(Request& r |
| if(XalanAttr *attr=element.getAttributeNode(*pool.transcode(name))) { | if(XalanAttr *attr=element.getAttributeNode(*pool.transcode(name))) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, attr); | VXnode& result=*new(pool) VXnode(pool, attr, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } | } |
| Line 240 static void _setAttributeNode(Request& r | Line 240 static void _setAttributeNode(Request& r |
| try { | try { |
| if(XalanAttr *returnAttr=element.setAttributeNode(&newAttr)) { | if(XalanAttr *returnAttr=element.setAttributeNode(&newAttr)) { |
| // write out result | // write out result |
| VXnode& result=*new(pool) VXnode(pool, returnAttr); | VXnode& result=*new(pool) VXnode(pool, returnAttr, false); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 257 static void _removeAttributeNode(Request | Line 257 static void _removeAttributeNode(Request |
| try { | try { |
| /*XalanAttr *returnAttr*/element.removeAttributeNode(&oldAttr); | /*XalanAttr *returnAttr*/element.removeAttributeNode(&oldAttr); |
| } catch(const XalanDOMException& e) { | } catch(const XalanDOMException& e) { |
| Exception::convert(pool, &method_name, e); | Exception::provide_source(pool, &method_name, e); |
| } | } |
| } | } |
| Line 279 static void _getElementsByTagName(Reques | Line 279 static void _getElementsByTagName(Reques |
| skey << buf; | skey << buf; |
| } | } |
| result.hash().put(skey, new(pool) VXnode(pool, nodes->item(i))); | result.hash(0).put(skey, new(pool) VXnode(pool, nodes->item(i), false)); |
| } | } |
| } | } |
| Line 302 static void _select(Request& r, const St | Line 302 static void _select(Request& r, const St |
| // expression | // expression |
| const String& expression=params->as_string(0, "expression must be string"); | const String& expression=params->as_string(0, "expression must be string"); |
| const char *expression_cstr=expression.cstr(String::UL_AS_IS); | const char *expression_cstr=expression.cstr(); |
| XalanDOMString dstring(expression_cstr); | XalanDOMString dstring(expression_cstr); |
| const XalanDOMChar *expression_dcstr=dstring.c_str(); | const XalanDOMChar *expression_dcstr=dstring.c_str(); |
| Line 324 static void _select(Request& r, const St | Line 324 static void _select(Request& r, const St |
| skey << buf; | skey << buf; |
| } | } |
| result.hash().put(skey, new(pool) VXnode(pool, list.item(i))); | result.hash(0).put(skey, new(pool) VXnode(pool, list.item(i), false)); |
| } | } |
| result.set_name(method_name); | result.set_name(method_name); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } catch(const XSLException& e) { | } catch(const XSLException& e) { |
| Exception::convert(pool, &expression, e); | Exception::provide_source(pool, &expression, e); |
| } | } |
| } | } |
| Line 340 static void _selectSingle(Request& r, co | Line 340 static void _selectSingle(Request& r, co |
| // expression | // expression |
| const String& expression=params->as_string(0, "expression must be string"); | const String& expression=params->as_string(0, "expression must be string"); |
| const char *expression_cstr=expression.cstr(String::UL_AS_IS); | const char *expression_cstr=expression.cstr(); |
| XalanDOMString dstring(expression_cstr); | XalanDOMString dstring(expression_cstr); |
| const XalanDOMChar *expression_dcstr=dstring.c_str(); | const XalanDOMChar *expression_dcstr=dstring.c_str(); |
| Line 355 static void _selectSingle(Request& r, co | Line 355 static void _selectSingle(Request& r, co |
| &vnode.get_node(pool, &method_name), | &vnode.get_node(pool, &method_name), |
| expression_dcstr)) { | expression_dcstr)) { |
| VXnode& result=*new(pool) VXnode(pool, node); | VXnode& result=*new(pool) VXnode(pool, node, false); |
| result.set_name(method_name); | result.set_name(method_name); |
| r.write_no_lang(result); | r.write_no_lang(result); |
| } | } |
| } catch(const XSLException& e) { | } catch(const XSLException& e) { |
| Exception::convert(pool, &expression, e); | Exception::provide_source(pool, &expression, e); |
| } | } |
| } | } |