Annotation of parser3/src/types/pa_vxdoc.C, revision 1.27

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.27    ! paf        10: static const char * const IDENT_VXDOC="$Date: 2003/11/20 16:34:30 $";
1.1       parser     11: 
                     12: #include "pa_vxdoc.h"
                     13: 
1.24      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.24      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.24      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();
                     31:                GdomeException exc;
                     32: 
                     33:                if(aname=="doctype") {
                     34:                        // readonly attribute DocumentType doctype;
                     35:                        return new VXnode(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 new VXnode(fcharsets, (GdomeNode *)gdome_doc_documentElement(document, &exc));
                     42:                }       
1.2       parser     43: 
1.25      paf        44:                return bark("%s field not found", &aname);
1.24      paf        45:        }
1.2       parser     46: }
                     47: 
1.1       parser     48: #endif

E-mail: