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

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.2! paf        10: static const char* IDENT_VXDOC="$Date: 2003/01/31 12:34:46 $";
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.2! paf        25:                if(ValuePtr result=VXnode::get_element(aname, aself, looking_up)) {
1.21      paf        26:                        return result;
                     27:                }
                     28:        } catch(Exception) { /* ignore bad node elements, they can be valid here */ }
1.8       paf        29: 
                     30:        // fields
1.23.2.2! paf        31:        GdomeDocument* document=get_document(aname);
1.8       paf        32:        GdomeException exc;
                     33: 
1.23.2.2! paf        34:        if(*aname=="doctype") {
1.8       paf        35:                // readonly attribute DocumentType doctype;
1.23.2.2! paf        36:                return ValuePtr(new VXnode(fpool, (GdomeNode*)gdome_doc_doctype(document, &exc)));
        !            37:        } else if(*aname=="implementation") {
1.8       paf        38:                // readonly attribute DOMImplementation implementation;
                     39:                return 0;
1.23.2.2! paf        40:        } else if(*aname=="documentElement") {
1.8       paf        41:                // readonly attribute Element documentElement;
1.23.2.2! paf        42:                return ValuePtr(new VXnode(fpool, (GdomeNode *)gdome_doc_documentElement(document, &exc)));
1.8       paf        43:        }       
1.2       parser     44: 
1.23.2.2! paf        45:        bark("%s field not found", 0, aname);  return ValuePtr(0);
1.2       parser     46: }
                     47: 
1.1       parser     48: #endif

E-mail: