|
|
| version 1.95, 2002/06/28 09:59:00 | version 1.108.4.1, 2003/03/17 14:48:04 |
|---|---|
| Line 1 | Line 1 |
| /** @file | /** @file |
| Parser: @b xdoc parser class. | Parser: @b xdoc parser class. |
| Copyright (c) 2001, 2002 ArtLebedev Group (http://www.artlebedev.com) | Copyright (c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com) |
| Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) | Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru) |
| $Id$ | |
| */ | */ |
| #include "classes.h" | #include "classes.h" |
| #ifdef XML | #ifdef XML |
| static const char* IDENT_XDOC_C="$Date$"; | |
| #include "pa_stylesheet_connection.h" | #include "pa_stylesheet_connection.h" |
| #include "pa_request.h" | #include "pa_request.h" |
| #include "pa_vxdoc.h" | #include "pa_vxdoc.h" |
| Line 169 static void writeNode(Request& r, const | Line 170 static void writeNode(Request& r, const |
| // Element createElement(in DOMString tagName) raises(DOMException); | // Element createElement(in DOMString tagName) raises(DOMException); |
| static void _createElement(Request& r, const String& method_name, MethodParams *params) { | static void _createElement(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& tagName=params->as_string(0, "tagName must be string"); | const String& tagName=params->as_string(0, "tagName must be string"); |
| Line 184 static void _createElement(Request& r, c | Line 185 static void _createElement(Request& r, c |
| // DocumentFragment createDocumentFragment() | // DocumentFragment createDocumentFragment() |
| static void _createDocumentFragment(Request& r, const String& method_name, MethodParams *) { | static void _createDocumentFragment(Request& r, const String& method_name, MethodParams *) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| GdomeException exc; | GdomeException exc; |
| GdomeNode *node= | GdomeNode *node= |
| Line 197 static void _createDocumentFragment(Requ | Line 198 static void _createDocumentFragment(Requ |
| // Text createTextNode(in DOMString data); | // Text createTextNode(in DOMString data); |
| static void _createTextNode(Request& r, const String& method_name, MethodParams *params) { | static void _createTextNode(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& data=params->as_string(0, "data must be string"); | const String& data=params->as_string(0, "data must be string"); |
| Line 212 static void _createTextNode(Request& r, | Line 213 static void _createTextNode(Request& r, |
| // Comment createComment(in DOMString data) | // Comment createComment(in DOMString data) |
| static void _createComment(Request& r, const String& method_name, MethodParams *params) { | static void _createComment(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& data=params->as_string(0, "data must be string"); | const String& data=params->as_string(0, "data must be string"); |
| Line 227 static void _createComment(Request& r, c | Line 228 static void _createComment(Request& r, c |
| // CDATASection createCDATASection(in DOMString data) raises(DOMException); | // CDATASection createCDATASection(in DOMString data) raises(DOMException); |
| static void _createCDATASection(Request& r, const String& method_name, MethodParams *params) { | static void _createCDATASection(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& data=params->as_string(0, "data must be string"); | const String& data=params->as_string(0, "data must be string"); |
| Line 242 static void _createCDATASection(Request& | Line 243 static void _createCDATASection(Request& |
| // ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) raises(DOMException); | // ProcessingInstruction createProcessingInstruction(in DOMString target,in DOMString data) raises(DOMException); |
| static void _createProcessingInstruction(Request& r, const String& method_name, MethodParams *params) { | static void _createProcessingInstruction(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& target=params->as_string(0, "data must be string"); | const String& target=params->as_string(0, "data must be string"); |
| const String& data=params->as_string(1, "data must be string"); | const String& data=params->as_string(1, "data must be string"); |
| Line 259 static void _createProcessingInstruction | Line 260 static void _createProcessingInstruction |
| // Attr createAttribute(in DOMString name) raises(DOMException); | // Attr createAttribute(in DOMString name) raises(DOMException); |
| static void _createAttribute(Request& r, const String& method_name, MethodParams *params) { | static void _createAttribute(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& name=params->as_string(0, "name must be string"); | const String& name=params->as_string(0, "name must be string"); |
| Line 273 static void _createAttribute(Request& r, | Line 274 static void _createAttribute(Request& r, |
| // EntityReference createEntityReference(in DOMString name) raises(DOMException); | // EntityReference createEntityReference(in DOMString name) raises(DOMException); |
| static void _createEntityReference(Request& r, const String& method_name, MethodParams *params) { | static void _createEntityReference(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& name=params->as_string(0, "name must be string"); | const String& name=params->as_string(0, "name must be string"); |
| Line 285 static void _createEntityReference(Reque | Line 286 static void _createEntityReference(Reque |
| writeNode(r, method_name, node, exc); | writeNode(r, method_name, node, exc); |
| } | } |
| // NodeList getElementsByTagName(in DOMString name); | |
| static void _getElementsByTagName(Request& r, const String& method_name, MethodParams *params) { | |
| Pool& pool=r.pool(); | |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); | |
| const String& name=params->as_string(0, "name must be string"); | |
| VHash& result=*new(pool) VHash(pool); | |
| GdomeException exc; | |
| if(GdomeNodeList *nodes= | |
| gdome_doc_getElementsByTagName( | |
| vdoc.get_document(&method_name), | |
| pool.transcode(name).get(), | |
| &exc)) { | |
| gulong length=gdome_nl_length(nodes, &exc); | |
| for(gulong i=0; i<length; i++) { | |
| String& skey=*new(pool) String(pool); | |
| { | |
| char *buf=(char *)pool.malloc_atomic(MAX_NUMBER); | |
| snprintf(buf, MAX_NUMBER, "%d", i); | |
| skey << buf; | |
| } | |
| result.hash(0).put(skey, new(pool) VXnode(pool, gdome_nl_item(nodes, i, &exc))); | |
| } | |
| } else if(exc) | |
| throw Exception( | |
| &method_name, | |
| exc); | |
| // write out result | |
| r.write_no_lang(result); | |
| } | |
| static void _getElementsByTagNameNS(Request& r, const String& method_name, MethodParams *params) { | |
| Pool& pool=r.pool(); | |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); | |
| // namespaceURI;localName | |
| const String& namespaceURI=params->as_string(0, "namespaceURI must be string"); | |
| const String& localName=params->as_string(1, "localName must be string"); | |
| GdomeException exc; | |
| VHash& result=*new(pool) VHash(pool); | |
| if(GdomeNodeList *nodes= | |
| gdome_doc_getElementsByTagNameNS( | |
| vdoc.get_document(&method_name), | |
| pool.transcode(namespaceURI).get(), | |
| pool.transcode(localName).get(), | |
| &exc)) { | |
| gulong length=gdome_nl_length(nodes, &exc); | |
| for(gulong i=0; i<length; i++) { | |
| String& skey=*new(pool) String(pool); | |
| { | |
| char *buf=(char *)pool.malloc_atomic(MAX_NUMBER); | |
| snprintf(buf, MAX_NUMBER, "%d", i); | |
| skey << buf; | |
| } | |
| result.hash(0).put(skey, new(pool) VXnode(pool, gdome_nl_item(nodes, i, &exc))); | |
| } | |
| } | |
| // write out result | |
| r.write_no_lang(result); | |
| } | |
| static void _getElementById(Request& r, const String& method_name, MethodParams *params) { | static void _getElementById(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| // elementId | // elementId |
| const String& elementId=params->as_string(0, "elementID must be string"); | const String& elementId=params->as_string(0, "elementID must be string"); |
| Line 308 static void _getElementById(Request& r, | Line 376 static void _getElementById(Request& r, |
| static void _importNode(Request& r, const String& method_name, MethodParams *params) { | static void _importNode(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| GdomeNode *importedNode= | GdomeNode *importedNode= |
| as_node(method_name, params, 0, "importedNode must be node"); | as_node(method_name, params, 0, "importedNode must be node"); |
| Line 334 GdomeAttr *gdome_doc_createAttributeNS ( | Line 402 GdomeAttr *gdome_doc_createAttributeNS ( |
| static void _create(Request& r, const String& method_name, MethodParams *params) { | static void _create(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| Value& param=params->get(params->size()-1); | Value& param=params->get(params->size()-1); |
| GdomeDocument *document; | GdomeDocument *document; |
| Line 379 static void _create(Request& r, const St | Line 447 static void _create(Request& r, const St |
| &method_name, | &method_name, |
| exc); | exc); |
| xmlDoc *doc=gdome_xml_doc_get_xmlDoc(document); | |
| const char *source_charset_name=pool.get_source_charset().name().cstr(); | |
| doc->encoding=pool.get_source_charset().transcode_buf2xchar(source_charset_name, strlen(source_charset_name)); | |
| /// +xalan createXMLDecl ? | /// +xalan createXMLDecl ? |
| } | } |
| Line 399 static void _create(Request& r, const St | Line 471 static void _create(Request& r, const St |
| static void _load(Request& r, const String& method_name, MethodParams *params) { | static void _load(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| // filespec | // filespec |
| const String& file_name=params->as_string(0, "uri must be string"); | const String& file_name=params->as_string(0, "uri must be string"); |
| const String& uri=r.absolute(file_name); | const String& uri=r.absolute(file_name); |
| void *data; size_t size; | |
| file_read(pool, uri, data, size, false/*not text*/, | |
| params->size()>1?params->as_no_junction(1, "additional params must be hash").get_hash(&method_name) | |
| :0); | |
| GdomeDocument *document=(GdomeDocument *) | GdomeDocument *document=(GdomeDocument *) |
| gdome_xml_n_mkref((xmlNode *)xmlParseFile(uri.cstr())); | gdome_xml_n_mkref((xmlNode *)xmlParseMemory((const char *)data, size)); |
| if(!document || xmlHaveGenericErrors()) { | if(!document || xmlHaveGenericErrors()) { |
| GdomeException exc=0; | GdomeException exc=0; |
| throw Exception( | throw Exception( |
| &uri, | &uri, |
| exc); | exc); |
| } | } |
| const char *URI_cstr=uri.cstr(); | |
| xmlDoc *doc=gdome_xml_doc_get_xmlDoc(document); | |
| if(URI_cstr) | |
| doc->URL=pool.transcode_buf2xchar(URI_cstr, strlen(URI_cstr)); | |
| // replace any previous parsed source | // replace any previous parsed source |
| vdoc.set_document(document); | vdoc.set_document(document); |
| Line 442 static void param_option_over_output_opt | Line 523 static void param_option_over_output_opt |
| } | } |
| } | } |
| /// @test valid_options check | |
| static void prepare_output_options( | static void prepare_output_options( |
| Pool& pool, const String& method_name, MethodParams *params, int index, | Pool& pool, const String& method_name, MethodParams *params, int index, |
| VXdoc::Output_options& oo) { | VXdoc::Output_options& oo) { |
| Line 535 static void xdoc2buf(Pool& pool, VXdoc& | Line 617 static void xdoc2buf(Pool& pool, VXdoc& |
| "xsltNewStylesheet failed"); | "xsltNewStylesheet failed"); |
| #define OOS2STYLE(name) \ | #define OOS2STYLE(name) \ |
| stylesheet->name=oo.name?BAD_CAST g_strdup(pool.transcode(*oo.name)->str):0 | stylesheet->name=oo.name?BAD_CAST xmlMemStrdup(pool.transcode(*oo.name)->str):0 |
| #define OOE2STYLE(name) \ | #define OOE2STYLE(name) \ |
| stylesheet->name=oo.name | stylesheet->name=oo.name |
| Line 572 static void xdoc2buf(Pool& pool, VXdoc& | Line 654 static void xdoc2buf(Pool& pool, VXdoc& |
| gnome_buf, gnome_size, | gnome_buf, gnome_size, |
| true/*as_text*/); | true/*as_text*/); |
| else if(*parser_size=gnome_size) { | else if(*parser_size=gnome_size) { |
| *parser_buf=(char *)pool.malloc(gnome_size); | *parser_buf=(char *)pool.malloc_atomic(gnome_size); |
| memcpy(*parser_buf, gnome_buf, gnome_size); | memcpy(*parser_buf, gnome_buf, gnome_size); |
| } else | } else |
| *parser_buf=0; | *parser_buf=0; |
| Line 580 static void xdoc2buf(Pool& pool, VXdoc& | Line 662 static void xdoc2buf(Pool& pool, VXdoc& |
| static void _file(Request& r, const String& method_name, MethodParams *params) { | static void _file(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| VXdoc::Output_options oo(vdoc.output_options); | VXdoc::Output_options oo(vdoc.output_options); |
| char *buf; size_t buf_size; | char *buf; size_t buf_size; |
| xdoc2buf(pool, vdoc, method_name, params, 0, | xdoc2buf(pool, vdoc, method_name, params, 0, |
| Line 602 static void _file(Request& r, const Stri | Line 684 static void _file(Request& r, const Stri |
| new(pool) VString(*oo.encoding)); | new(pool) VString(*oo.encoding)); |
| vcontent_type=vhcontent_type; | vcontent_type=vhcontent_type; |
| vfile.set(false/*tainted*/, buf, buf_size, 0/*file_name*/, vcontent_type); | vfile.set(false/*tainted*/, buf?buf:""/*to distinguish from stat-ed file*/, buf_size, |
| 0/*file_name*/, vcontent_type); | |
| r.write_no_lang(vfile); | r.write_no_lang(vfile); |
| } | } |
| static void _save(Request& r, const String& method_name, MethodParams *params) { | static void _save(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| const String& file_spec=r.absolute(params->as_string(0, "file name must be string")); | const String& file_spec=r.absolute(params->as_string(0, "file name must be string")); |
| Line 621 static void _save(Request& r, const Stri | Line 704 static void _save(Request& r, const Stri |
| static void _string(Request& r, const String& method_name, MethodParams *params) { | static void _string(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| VXdoc::Output_options oo(vdoc.output_options); | VXdoc::Output_options oo(vdoc.output_options); |
| char *buf; size_t buf_size; | char *buf; size_t buf_size; |
| xdoc2buf(pool, vdoc, method_name, params, 0, | xdoc2buf(pool, vdoc, method_name, params, 0, |
| Line 691 static VXdoc& _transform(Pool& pool, con | Line 774 static VXdoc& _transform(Pool& pool, con |
| memset(&result.output_options, 0, sizeof(result.output_options)); | memset(&result.output_options, 0, sizeof(result.output_options)); |
| VXdoc::Output_options& oo=result.output_options; | VXdoc::Output_options& oo=result.output_options; |
| oo.method=stylesheet->method?&pool.transcode(stylesheet->method):0; | oo.method=stylesheet->method?&pool.transcode(stylesheet->method, stylesheet_source):0; |
| oo.encoding=stylesheet->encoding?&pool.transcode(stylesheet->encoding):0; | oo.encoding=stylesheet->encoding?&pool.transcode(stylesheet->encoding, stylesheet_source):0; |
| oo.mediaType=stylesheet->mediaType?&pool.transcode(stylesheet->mediaType):0; | oo.mediaType=stylesheet->mediaType?&pool.transcode(stylesheet->mediaType, stylesheet_source):0; |
| oo.doctypeSystem=stylesheet->doctypeSystem?&pool.transcode(stylesheet->doctypeSystem):0; | oo.doctypeSystem=stylesheet->doctypeSystem?&pool.transcode(stylesheet->doctypeSystem, stylesheet_source):0; |
| oo.doctypePublic=stylesheet->doctypePublic?&pool.transcode(stylesheet->doctypePublic):0; | oo.doctypePublic=stylesheet->doctypePublic?&pool.transcode(stylesheet->doctypePublic, stylesheet_source):0; |
| oo.indent=stylesheet->indent!=0; | oo.indent=stylesheet->indent!=0; |
| oo.version=stylesheet->version?&pool.transcode(stylesheet->version):0; | oo.version=stylesheet->version?&pool.transcode(stylesheet->version, stylesheet_source):0; |
| oo.standalone=stylesheet->standalone!=0; | oo.standalone=stylesheet->standalone!=0; |
| oo.omitXmlDeclaration=stylesheet->omitXmlDeclaration!=0; | oo.omitXmlDeclaration=stylesheet->omitXmlDeclaration!=0; |
| Line 706 static VXdoc& _transform(Pool& pool, con | Line 789 static VXdoc& _transform(Pool& pool, con |
| } | } |
| static void _transform(Request& r, const String& method_name, MethodParams *params) { | static void _transform(Request& r, const String& method_name, MethodParams *params) { |
| Pool& pool=r.pool(); | Pool& pool=r.pool(); |
| VXdoc& vdoc=*static_cast<VXdoc *>(r.self); | VXdoc& vdoc=*static_cast<VXdoc *>(r.get_self()); |
| // params | // params |
| const char **transform_params=0; | const char **transform_params=0; |
| if(params->size()>1) { | if(params->size()>1) { |
| Value& vparams=params->as_no_junction(1, "transform parameters must be hash"); | Value& vparams=params->as_no_junction(1, "transform parameters must be hash"); |
| if(vparams.is_defined()) | if(!vparams.is_string()) |
| if(Hash *params=vparams.get_hash(&method_name)) { | if(Hash *params=vparams.get_hash(&method_name)) { |
| const char **current_transform_param=transform_params= | const char **current_transform_param=transform_params= |
| (const char **)pool.malloc(sizeof(const char *)*(params->size()*2+1)); | (const char **)pool.malloc(sizeof(const char *)*(params->size()*2+1)); |
| Line 726 static void _transform(Request& r, const | Line 809 static void _transform(Request& r, const |
| VXdoc *result; | VXdoc *result; |
| Value& vmaybe_xdoc=params->get(0); | Value& vmaybe_xdoc=params->get(0); |
| if(strcmp(vmaybe_xdoc.type(), VXDOC_TYPE)==0) { // stylesheet (xdoc) | if(Value *vxdoc=vmaybe_xdoc.as(VXDOC_TYPE, false)) { // stylesheet (xdoc) |
| xmlDoc *document=gdome_xml_doc_get_xmlDoc( | xmlDoc *document=gdome_xml_doc_get_xmlDoc( |
| static_cast<VXdoc *>(&vmaybe_xdoc)->get_document(&method_name)); | static_cast<VXdoc *>(vxdoc)->get_document(&method_name)); |
| // compile xdoc stylesheet | // compile xdoc stylesheet |
| xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(document)); | xsltStylesheet_auto_ptr stylesheet_ptr(xsltParseStylesheetDoc(document)); |
| // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor | // strange thing - xsltParseStylesheetDoc records document and destroys it in stylesheet destructor |
| Line 786 MXdoc::MXdoc(Pool& apool) : MXnode(apool | Line 869 MXdoc::MXdoc(Pool& apool) : MXnode(apool |
| add_native_method("createAttribute", Method::CT_DYNAMIC, _createAttribute, 1, 1); | add_native_method("createAttribute", Method::CT_DYNAMIC, _createAttribute, 1, 1); |
| // EntityReference createEntityReference(in DOMString name) raises(DOMException); | // EntityReference createEntityReference(in DOMString name) raises(DOMException); |
| add_native_method("createEntityReference", Method::CT_DYNAMIC, _createEntityReference, 1, 1); | add_native_method("createEntityReference", Method::CT_DYNAMIC, _createEntityReference, 1, 1); |
| // NodeList getElementsByTagName(in DOMString name); | |
| add_native_method("getElementsByTagName", Method::CT_DYNAMIC, _getElementsByTagName, 1, 1); | |
| /// DOM2 | /// DOM2 |
| Line 795 MXdoc::MXdoc(Pool& apool) : MXnode(apool | Line 880 MXdoc::MXdoc(Pool& apool) : MXnode(apool |
| // Node (in Node importedNode, in boolean deep) raises(DOMException) | // Node (in Node importedNode, in boolean deep) raises(DOMException) |
| add_native_method("importNode", Method::CT_DYNAMIC, _importNode, 2, 2); | add_native_method("importNode", Method::CT_DYNAMIC, _importNode, 2, 2); |
| // NodeList getElementsByTagNameNS(in DOMString namespaceURI, in DOMString localName); | |
| add_native_method("getElementsByTagNameNS", Method::CT_DYNAMIC, _getElementsByTagNameNS, 2, 2); | |
| /// parser | /// parser |
| // ^xdoc::create{qualifiedName} | // ^xdoc::create{qualifiedName} |
| Line 805 MXdoc::MXdoc(Pool& apool) : MXnode(apool | Line 893 MXdoc::MXdoc(Pool& apool) : MXnode(apool |
| add_native_method("set", Method::CT_DYNAMIC, _create, 1, 1); | add_native_method("set", Method::CT_DYNAMIC, _create, 1, 1); |
| // ^xdoc::load[some.xml] | // ^xdoc::load[some.xml] |
| add_native_method("load", Method::CT_DYNAMIC, _load, 1, 1); | add_native_method("load", Method::CT_DYNAMIC, _load, 1, 2); |
| // ^xdoc.save[some.xml] | // ^xdoc.save[some.xml] |
| // ^xdoc.save[some.xml;options hash] | // ^xdoc.save[some.xml;options hash] |
| Line 819 MXdoc::MXdoc(Pool& apool) : MXnode(apool | Line 907 MXdoc::MXdoc(Pool& apool) : MXnode(apool |
| // ^xdoc.file[options hash] file with "<doc/>" | // ^xdoc.file[options hash] file with "<doc/>" |
| add_native_method("file", Method::CT_DYNAMIC, _file, 0, 1); | add_native_method("file", Method::CT_DYNAMIC, _file, 0, 1); |
| // ^xdoc.transform[stylesheet file_name] | // ^xdoc.transform[stylesheet file_name/xdoc] |
| // ^xdoc.transform[stylesheet file_name;params hash] | // ^xdoc.transform[stylesheet file_name/xdoc;params hash] |
| add_native_method("transform", Method::CT_DYNAMIC, _transform, 1, 2); | add_native_method("transform", Method::CT_DYNAMIC, _transform, 1, 2); |
| } | } |