Annotation of parser3/src/types/pa_vxdoc.C, revision 1.30
1.1 parser 1: /** @dom
2: Parser: @b dom parser type.
3:
1.29 paf 4: Copyright(c) 2001-2005 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.30 ! paf 10: static const char * const IDENT_VXDOC="$Date: 2005/08/09 08:14:56 $";
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.30 ! paf 18:
! 19: VXnode& VXdoc::wrap(xmlNode& anode) {
! 20: VXnode* result;
! 21: if((result=static_cast<VXnode*>(anode._private))) {
! 22: assert(anode.doc==fdocument);
! 23: return *result;
! 24: }
! 25:
! 26: result=new VXnode(anode);
! 27: anode._private=result;
! 28: anode.doc=fdocument;
! 29:
! 30: return *result;
! 31: }
! 32:
! 33:
1.24 paf 34: Value* VXdoc::as(const char* atype, bool looking_up) {
35: if(Value* result=Value::as(atype, looking_up))
1.19 paf 36: return result;
1.18 paf 37: else
1.19 paf 38: return VXnode::as(atype, looking_up);
1.18 paf 39: }
40:
1.2 parser 41: /// VXdoc: $CLASS,$method
1.24 paf 42: Value* VXdoc::get_element(const String& aname, Value& aself, bool looking_up) {
1.28 paf 43: if(aname==SEARCH_NAMESPACES_NAME) {
44: return &search_namespaces;
45: }
46:
1.13 paf 47: // up
1.21 paf 48: try {
1.24 paf 49: return VXnode::get_element(aname, aself, looking_up);
50: } catch(Exception) {
51: // ignore bad node elements, they can be valid here...
52:
53: // fields
1.30 ! paf 54: /* someday
1.24 paf 55: GdomeDocument* document=get_document();
56: GdomeException exc;
57:
58: if(aname=="doctype") {
59: // readonly attribute DocumentType doctype;
1.30 ! paf 60: return new VXnode(fcharsets, *this, (xmlNode*)gdome_doc_doctype(document, &exc));
1.24 paf 61: } else if(aname=="implementation") {
62: // readonly attribute DOMImplementation implementation;
63: return 0;
64: } else if(aname=="documentElement") {
65: // readonly attribute Element documentElement;
1.30 ! paf 66: return new VXnode(fcharsets, *this, (xmlNode *)gdome_doc_documentElement(document, &exc));
1.24 paf 67: }
1.30 ! paf 68: */
1.25 paf 69: return bark("%s field not found", &aname);
1.24 paf 70: }
1.2 parser 71: }
72:
1.1 parser 73: #endif
E-mail: