|
|
| version 1.87, 2012/03/16 09:24:08 | version 1.91, 2015/10/26 01:21:55 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b dom parser class. | Parser: @b dom parser class. |
| Copyright (c) 2001-2012 Art. Lebedev Studio (http://www.artlebedev.com) | Copyright (c) 2001-2015 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 148 xmlAttr& as_attr(MethodParams& params, i | Line 148 xmlAttr& as_attr(MethodParams& params, i |
| static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { | static void writeNode(Request& r, VXdoc& xdoc, xmlNode* node) { |
| if(!node|| xmlHaveGenericErrors()) | if(!node|| xmlHaveGenericErrors()) |
| throw XmlException(0); // 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_no_lang(xdoc.wrap(*node)); |
| Line 162 static xmlNode* pa_getAttributeNodeNS(xm | Line 162 static xmlNode* pa_getAttributeNodeNS(xm |
| currentNode; | currentNode; |
| currentNode=currentNode->next) | currentNode=currentNode->next) |
| { | { |
| if(!namespaceURI || currentNode->ns && xmlStrEqual(currentNode->ns->href, namespaceURI)) | if(!namespaceURI || (currentNode->ns && xmlStrEqual(currentNode->ns->href, namespaceURI)) ) |
| if(!localName || xmlStrEqual(currentNode->name, localName)) | if(!localName || xmlStrEqual(currentNode->name, localName)) |
| return currentNode; | return currentNode; |
| } | } |
| Line 184 xmlNs& pa_xmlMapNs(xmlDoc& doc, const xm | Line 184 xmlNs& pa_xmlMapNs(xmlDoc& doc, const xm |
| if (cur == NULL) { | if (cur == NULL) { |
| cur = xmlNewNs (NULL, href, prefix); | cur = xmlNewNs (NULL, href, prefix); |
| if(!cur || xmlHaveGenericErrors()) | if(!cur || xmlHaveGenericErrors()) |
| throw XmlException(0); | throw XmlException(); |
| cur->next = doc.oldNs; | cur->next = doc.oldNs; |
| doc.oldNs = cur; | doc.oldNs = cur; |
| } | } |
| Line 412 static void _setAttribute(Request& r, Me | Line 412 static void _setAttribute(Request& r, Me |
| // @todo: when name="xmlns" | // @todo: when name="xmlns" |
| if(!xmlSetProp(&element, name, attribute_value)) | if(!xmlSetProp(&element, name, attribute_value)) |
| throw XmlException(0); | throw XmlException(0, r); |
| } | } |
| // void removeAttribute(in DOMString name) raises(DOMException); | // void removeAttribute(in DOMString name) raises(DOMException); |
| Line 557 static void _setAttributeNS(Request& r, | Line 557 static void _setAttributeNS(Request& r, |
| } | } |
| if(!attrNode) | if(!attrNode) |
| throw XmlException(0); | throw XmlException(0, r); |
| } | } |
| // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); | // void removeAttributeNS(in DOMString namespaceURI, in DOMString localName) raises(DOMException); |
| Line 706 static void _selectX(Request& r, MethodP | Line 706 static void _selectX(Request& r, MethodP |
| xmlXPathEvalExpression(r.transcode(expression), ctxt.get())); | xmlXPathEvalExpression(r.transcode(expression), ctxt.get())); |
| if(xmlHaveGenericErrors()) | if(xmlHaveGenericErrors()) |
| throw XmlException(0); | throw XmlException(0, r); |
| Value* result=0; | Value* result=0; |
| if(res.get()) | if(res.get()) |
| Line 943 MXnode::MXnode(const char* aname, VState | Line 943 MXnode::MXnode(const char* aname, VState |
| // consts | // consts |
| #define CONST(name) \ | #define CONST(name) consts.put(#name, new VInt(XML_##name)) |
| consts.put(String::Body(#name), new VInt(XML_##name)) | #define CONST2(name, value) consts.put(#name, new VInt(value)) |
| #define CONST2(name, value) \ | |
| consts.put(String::Body(#name), new VInt(value)) | |
| CONST(ELEMENT_NODE); | CONST(ELEMENT_NODE); |
| CONST(ATTRIBUTE_NODE); | CONST(ATTRIBUTE_NODE); |