Annotation of parser3/src/types/pa_vxdoc.C, revision 1.28
1.1 parser 1: /** @dom
2: Parser: @b dom parser type.
3:
1.27 paf 4: Copyright(c) 2001-2004 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.28 ! paf 10: static const char * const IDENT_VXDOC="$Date: 2004/02/11 15:33:19 $";
1.1 parser 11:
12: #include "pa_vxdoc.h"
13:
1.28 ! paf 14: // defines
! 15:
! 16: #define SEARCH_NAMESPACES_NAME "search-namespaces"
! 17:
1.24 paf 18: Value* VXdoc::as(const char* atype, bool looking_up) {
19: if(Value* result=Value::as(atype, looking_up))
1.19 paf 20: return result;
1.18 paf 21: else
1.19 paf 22: return VXnode::as(atype, looking_up);
1.18 paf 23: }
24:
1.2 parser 25: /// VXdoc: $CLASS,$method
1.24 paf 26: Value* VXdoc::get_element(const String& aname, Value& aself, bool looking_up) {
1.28 ! paf 27: if(aname==SEARCH_NAMESPACES_NAME) {
! 28: return &search_namespaces;
! 29: }
! 30:
1.13 paf 31: // up
1.21 paf 32: try {
1.24 paf 33: return VXnode::get_element(aname, aself, looking_up);
34: } catch(Exception) {
35: // ignore bad node elements, they can be valid here...
36:
37: // fields
38: GdomeDocument* document=get_document();
39: GdomeException exc;
40:
41: if(aname=="doctype") {
42: // readonly attribute DocumentType doctype;
1.28 ! paf 43: return new VXnode(fcharsets, *this, (GdomeNode*)gdome_doc_doctype(document, &exc));
1.24 paf 44: } else if(aname=="implementation") {
45: // readonly attribute DOMImplementation implementation;
46: return 0;
47: } else if(aname=="documentElement") {
48: // readonly attribute Element documentElement;
1.28 ! paf 49: return new VXnode(fcharsets, *this, (GdomeNode *)gdome_doc_documentElement(document, &exc));
1.24 paf 50: }
1.2 parser 51:
1.25 paf 52: return bark("%s field not found", &aname);
1.24 paf 53: }
1.2 parser 54: }
55:
1.1 parser 56: #endif
E-mail: