|
|
| version 1.78, 2002/01/28 08:20:33 | version 1.80, 2002/01/29 08:45:36 |
|---|---|
| Line 7 | Line 7 |
| $Id$ | $Id$ |
| */ | */ |
| #include "pa_types.h" | #include "pa_types.h" |
| #include "classes.h" | |
| #ifdef XML | #ifdef XML |
| #include "gdome.h" | #include "gdome.h" |
| Line 20 extern "C" { | Line 21 extern "C" { |
| #include "libxslt/xsltutils.h" | #include "libxslt/xsltutils.h" |
| #include "pa_stylesheet_connection.h" | #include "pa_stylesheet_connection.h" |
| #include "classes.h" | |
| #include "pa_request.h" | #include "pa_request.h" |
| #include "pa_vxdoc.h" | #include "pa_vxdoc.h" |
| #include "pa_charset.h" | #include "pa_charset.h" |
| Line 371 static void _getElementById(Request& r, | Line 371 static void _getElementById(Request& r, |
| &method_name, | &method_name, |
| exc); | exc); |
| } | } |
| static void _importNode(Request& r, const String& method_name, MethodParams *params) { | |
| Pool& pool=r.pool(); | |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | |
| GdomeNode *importedNode= | |
| as_node(pool, method_name, params, 0, "importedNode must be node"); | |
| bool deep= | |
| params->as_bool(1, "deep must be bool", r); | |
| GdomeException exc; | |
| GdomeNode *outputNode=gdome_doc_importNode(vdoc.get_document(&method_name), | |
| importedNode, | |
| deep, &exc); | |
| if(exc) | |
| throw Exception(0, 0, | |
| &method_name, | |
| exc); | |
| // write out result | |
| r.write_no_lang(*new(pool) VXnode(pool, outputNode)); | |
| } | |
| /* | /* |
| GdomeNode *gdome_doc_importNode (GdomeDocument *self, GdomeNode *importedNode, GdomeBoolean deep, GdomeException *exc); | |
| GdomeElement *gdome_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); | GdomeElement *gdome_doc_createElementNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); |
| GdomeAttr *gdome_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); | GdomeAttr *gdome_doc_createAttributeNS (GdomeDocument *self, GdomeDOMString *namespaceURI, GdomeDOMString *qualifiedName, GdomeException *exc); |
| */ | */ |
| Line 592 static void xdoc2buf(Pool& pool, VXdoc& | Line 613 static void xdoc2buf(Pool& pool, VXdoc& |
| OOE2STYLE(omitXmlDeclaration); | OOE2STYLE(omitXmlDeclaration); |
| xmlDoc *document=gdome_xml_doc_get_xmlDoc(vdoc.get_document(&method_name)); | xmlDoc *document=gdome_xml_doc_get_xmlDoc(vdoc.get_document(&method_name)); |
| if(xsltSaveResultTo(outputBuffer.get(), document, stylesheet.get())<0) { | if(xsltSaveResultTo n(outputBuffer.get(), document, stylesheet.get())<0) { |
| GdomeException exc=0; | GdomeException exc=0; |
| throw Exception(0, 0, | throw Exception(0, 0, |
| &method_name, | &method_name, |
| Line 797 MXdoc::MXdoc(Pool& apool) : MXnode(apool | Line 818 MXdoc::MXdoc(Pool& apool) : MXnode(apool |
| // ^xdoc.getElementsByTagNameNS[namespaceURI;localName] = array of nodes | // ^xdoc.getElementsByTagNameNS[namespaceURI;localName] = array of nodes |
| add_native_method("getElementsByTagNameNS", Method::CT_DYNAMIC, _getElementsByTagNameNS, 2, 2); | add_native_method("getElementsByTagNameNS", Method::CT_DYNAMIC, _getElementsByTagNameNS, 2, 2); |
| /// DOM2(?) | /// DOM2 |
| // ^xdoc.getElementById[elementId] | // ^xdoc.getElementById[elementId] |
| add_native_method("getElementById", Method::CT_DYNAMIC, _getElementById, 1, 1); | add_native_method("getElementById", Method::CT_DYNAMIC, _getElementById, 1, 1); |
| // Node (in Node importedNode, in boolean deep) raises(DOMException) | |
| add_native_method("importNode", Method::CT_DYNAMIC, _importNode, 2, 2); | |
| /// parser | /// parser |
| // ^xdoc::create{qualifiedName} | // ^xdoc::create{qualifiedName} |