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