Annotation of parser3/src/types/pa_vxdoc.C, revision 1.23.2.5.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.5.2.4! paf 10: static const char* IDENT_VXDOC="$Date: 2003/03/21 13:42:35 $";
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.5.2.3 paf 22: Value* VXdoc::get_element(const String& 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
1.23.2.5.2.4! paf 30: GdomeDocument* document=get_document();
1.23.2.4 paf 31: GdomeException exc;
32:
1.23.2.5.2.3 paf 33: if(aname=="doctype") {
1.23.2.4 paf 34: // readonly attribute DocumentType doctype;
1.23.2.5.2.4! paf 35: return new VXnode(fcharsets, (GdomeNode*)gdome_doc_doctype(document, &exc));
1.23.2.5.2.3 paf 36: } else if(aname=="implementation") {
1.23.2.4 paf 37: // readonly attribute DOMImplementation implementation;
1.23.2.5.2.3 paf 38: return 0;
39: } else if(aname=="documentElement") {
1.23.2.4 paf 40: // readonly attribute Element documentElement;
1.23.2.5.2.4! paf 41: return new VXnode(fcharsets, (GdomeNode *)gdome_doc_documentElement(document, &exc));
1.23.2.4 paf 42: }
1.2 parser 43:
1.23.2.5.2.4! paf 44: bark("%s field not found", 0, &aname); return 0;
1.23.2.4 paf 45: }
1.2 parser 46: }
47:
1.1 parser 48: #endif
E-mail: