|
|
| version 1.94, 2016/04/11 22:58:57 | version 1.97, 2020/12/15 17:10:29 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b dom parser class. | Parser: @b dom parser class. |
| Copyright (c) 2001-2015 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2020 Art. Lebedev Studio (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| */ | */ |
| #include "classes.h" | #include "classes.h" |
| Line 147 static void writeNode(Request& r, VXdoc& | Line 147 static void writeNode(Request& r, VXdoc& |
| throw XmlException(0, r); // OOM, bad name, things like that | throw XmlException(0, r); // OOM, bad name, things like that |
| // write out result | // write out result |
| r.write_no_lang(xdoc.wrap(*node)); | r.write(xdoc.wrap(*node)); |
| } | } |
| static xmlNode* pa_getAttributeNodeNS(xmlNode& selfNode, | static xmlNode* pa_getAttributeNodeNS(xmlNode& selfNode, |
| Line 355 static void _hasChildNodes(Request& r, M | Line 355 static void _hasChildNodes(Request& r, M |
| xmlNode& node=vnode.get_xmlnode(); | xmlNode& node=vnode.get_xmlnode(); |
| // write out result | // write out result |
| r.write_no_lang(VBool::get(node.children!=0)); | r.write(VBool::get(node.children!=0)); |
| } | } |
| // Node cloneNode(in boolean deep); | // Node cloneNode(in boolean deep); |
| Line 395 static void _getAttribute(Request& r, Me | Line 395 static void _getAttribute(Request& r, Me |
| // @todo: when name="xmlns" | // @todo: when name="xmlns" |
| xmlChar* attribute_value=xmlGetProp(&element, name); | xmlChar* attribute_value=xmlGetProp(&element, name); |
| // write out result | // write out result |
| r.write_pass_lang(r.transcode(attribute_value)); | r.write(r.transcode(attribute_value)); |
| } | } |
| // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); | // void setAttribute(in DOMString name, in DOMString value) raises(DOMException); |
| Line 504 static void _getElementsByTagName(Reques | Line 504 static void _getElementsByTagName(Reques |
| &info); | &info); |
| // write out result | // write out result |
| r.write_no_lang(result); | r.write(result); |
| } | } |
| // DOM 2 | // DOM 2 |
| Line 520 static void _getAttributeNS(Request& r, | Line 520 static void _getAttributeNS(Request& r, |
| // todo: when name="xmlns" | // todo: when name="xmlns" |
| xmlChar* attribute_value=xmlGetNsProp(&element, localName, namespaceURI); | xmlChar* attribute_value=xmlGetNsProp(&element, localName, namespaceURI); |
| // write out result | // write out result |
| r.write_pass_lang(r.transcode(attribute_value)); | r.write(r.transcode(attribute_value)); |
| } | } |
| Line 595 static void _hasAttribute(Request& r, Me | Line 595 static void _hasAttribute(Request& r, Me |
| // @todo: when name="xmlns" | // @todo: when name="xmlns" |
| // write out result | // write out result |
| r.write_no_lang(VBool::get(xmlHasProp(&element, name)!=0)); | r.write(VBool::get(xmlHasProp(&element, name)!=0)); |
| } | } |
| // boolean hasAttributeNS(n DOMString namespaceURI, in DOMString localName) raises(DOMException); | // boolean hasAttributeNS(n DOMString namespaceURI, in DOMString localName) raises(DOMException); |
| Line 607 static void _hasAttributeNS(Request& r, | Line 607 static void _hasAttributeNS(Request& r, |
| xmlNode& element=get_self_element(vnode); | xmlNode& element=get_self_element(vnode); |
| // write out result | // write out result |
| r.write_no_lang(VBool::get(xmlHasNsProp(&element, localName, namespaceURI)!=0)); | r.write(VBool::get(xmlHasNsProp(&element, localName, namespaceURI)!=0)); |
| } | } |
| // boolean hasAttributes | // boolean hasAttributes |
| Line 616 static void _hasAttributes(Request& r, M | Line 616 static void _hasAttributes(Request& r, M |
| xmlNode& element=get_self_element(vnode); | xmlNode& element=get_self_element(vnode); |
| // write out result | // write out result |
| r.write_no_lang(VBool::get(element.properties!=0)); | r.write(VBool::get(element.properties!=0)); |
| } | } |
| // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); | // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); |
| Line 642 static void _getElementsByTagNameNS(Requ | Line 642 static void _getElementsByTagNameNS(Requ |
| &info); | &info); |
| // write out result | // write out result |
| r.write_no_lang(result); | r.write(result); |
| } | } |
| Line 708 static void _selectX(Request& r, MethodP | Line 708 static void _selectX(Request& r, MethodP |
| if(res.get()) | if(res.get()) |
| handler(r, expression, res, vdoc, result); | handler(r, expression, res, vdoc, result); |
| if(result) | if(result) |
| r.write_no_lang(*result); | r.write(*result); |
| } | } |
| static void selectNodesHandler(Request&, | static void selectNodesHandler(Request&, |