00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef skXMLELEMENTOBJECT_H
00024 #define skXMLELEMENTOBJECT_H
00025
00026 #include "skExecutable.h"
00027 #include <xercesc/dom/deprecated/DOM_Element.hpp>
00028 #include <iostream.h>
00029 #include <xercesc/framework/XMLFormatter.hpp>
00030
00031 class skMethodTable;
00032
00033
00034
00035 #define XMLELEMENT_TYPE 2
00036
00037
00038
00039
00040
00041
00042
00043
00044 CLASSEXPORT extern ostream& operator<< (ostream& target, const DOMString& s);
00045
00063 class CLASSEXPORT skXMLElementObject : public skExecutable {
00064 public:
00068 skXMLElementObject();
00074 skXMLElementObject(const skString& location,DOM_Element elem);
00078 ~skXMLElementObject();
00083 int executableType() const;
00087 int intValue() const;
00088 #ifdef USE_FLOATING_POINT
00089
00092 float floatValue() const;
00093 #endif
00094
00097 bool boolValue() const;
00101 Char charValue() const;
00105 skString strValue() const;
00113 bool setValue(const skString& name,const skString& attribute,const skRValue& return_value);
00121 bool setValueAt(const skRValue& array_index,const skString& attribute,const skRValue& value);
00131 bool getValue(const skString& name,const skString& attribute,skRValue& return_value);
00136 bool getValueAt(const skRValue& array_index,const skString& attribute,skRValue& value);
00151 bool method(const skString& name,skRValueArray& args,skRValue& ret,skExecutableContext& ctxt);
00156 void copyItemsInto(DOM_Element other);
00160 virtual void setAddIfNotPresent(bool enable);
00164 virtual bool getAddIfNotPresent();
00169 DOM_Element getElement();
00175 static skString getData(DOM_Element element);
00181 static void setData(DOM_Element element,const skString& data);
00188 static DOM_Element findChild(DOM_Element parent,const skString& tagname);
00195 static DOM_Element findChild(DOM_Element parent,int index);
00204 static DOM_Element findChild(DOM_Element parent,const skString& tagname,const skString& attribute,const skString& value);
00208 void setAttribute(skString name,const skString& value);
00213 skString getAttribute(const skString& name);
00217 static skString toString(DOMString str);
00221 static DOMString fromString(const skString& str);
00225 skString getLocation() const;
00227 static int countChildren(DOM_Element parent);
00232 void save(ostream& out);
00236 virtual skString getSource(const skString& location);
00241 virtual void getInstanceVariables(skRValueTable& table);
00246 virtual void getAttributes(skRValueTable& table);
00247 protected:
00252 virtual void setElement(DOM_Element element);
00258 virtual skXMLElementObject * createXMLElementObject(const skString& location,DOM_Element element);
00262 skString m_ScriptLocation;
00267 skExecutableIterator * createIterator(const skString& qualifier);
00271 skExecutableIterator * createIterator();
00272 private:
00276 DOM_Element m_Element;
00280 skMethodTable * m_MethodCache;
00284 skXMLElementObject(const skXMLElementObject&);
00288 skXMLElementObject& operator=(const skXMLElementObject&);
00290 void save(ostream& target, DOM_Node& toWrite,XMLFormatter& formatter,XMLCh* encoding_name);
00295 bool m_AddIfNotPresent;
00296
00297 };
00298
00299 #endif