Annotation of parser3/src/types/pa_vxdoc.C, revision 1.23
1.1 parser 1: /** @dom
2: Parser: @b dom parser type.
3:
1.23 ! paf 4: Copyright(c) 2001, 2003 ArtLebedev Group (http://www.artlebedev.com)
1.11 paf 5: Author: Alexandr Petrosian <paf@design.ru> (http://paf.design.ru)
1.1 parser 6: */
7: #include "pa_config_includes.h"
8: #ifdef XML
1.14 paf 9:
1.23 ! paf 10: static const char* IDENT_VXDOC="$Date: 2002/10/31 15:01:57 $";
1.1 parser 11:
12: #include "pa_vxdoc.h"
13:
1.7 paf 14: void VXdoc_destructor(void *vxdoc) {
1.1 parser 15: //_asm int 3;
1.7 paf 16: static_cast<VXdoc *>(vxdoc)->~VXdoc();
1.1 parser 17: }
1.2 parser 18:
1.19 paf 19: Value *VXdoc::as(const char *atype, bool looking_up) {
20: if(Value *result=Value::as(atype, looking_up))
21: return result;
1.18 paf 22: else
1.19 paf 23: return VXnode::as(atype, looking_up);
1.18 paf 24: }
25:
1.2 parser 26: /// VXdoc: $CLASS,$method
1.22 paf 27: Value *VXdoc::get_element(const String& aname, Value& aself, bool looking_up) {
1.13 paf 28: // up
1.21 paf 29: try {
30: if(Value *result=VXnode::get_element(aname, aself, looking_up)) {
31: return result;
32: }
33: } catch(Exception) { /* ignore bad node elements, they can be valid here */ }
1.8 paf 34:
35: // fields
1.16 paf 36: GdomeDocument *document=get_document(&aname);
1.8 paf 37: GdomeException exc;
38:
1.16 paf 39: if(aname=="doctype") {
1.8 paf 40: // readonly attribute DocumentType doctype;
1.9 paf 41: return NEW VXnode(pool(), (GdomeNode *)gdome_doc_doctype(document, &exc));
1.16 paf 42: } else if(aname=="implementation") {
1.8 paf 43: // readonly attribute DOMImplementation implementation;
44: return 0;
1.16 paf 45: } else if(aname=="documentElement") {
1.8 paf 46: // readonly attribute Element documentElement;
1.9 paf 47: return NEW VXnode(pool(), (GdomeNode *)gdome_doc_documentElement(document, &exc));
1.8 paf 48: }
1.2 parser 49:
1.20 paf 50: bark("%s field not found", 0, &aname); return 0;
1.2 parser 51: }
52:
1.1 parser 53: #endif
E-mail: