Main Page   Class Hierarchy   Compound List   File List   Compound Members  

XPathHelper.h

00001 /*
00002 * Class XPathHelper
00003 * This class talks directly to the VOTable XML document.
00004 * This class is used for getting all required information
00005 * such as VTable, MetaData, and Data from the XML document.
00006 *
00007 * Used internally.
00008 */
00009 
00010 
00011 #ifndef XPATH_HELPER_H
00012 #define XPATH_HELPER_H
00013 
00014 // Base header file.  Must be first.
00015 #include "Include/PlatformDefinitions.hpp"
00016 
00017 #include <cassert>
00018 
00019 
00020 //#if defined(XALAN_OLD_STREAM_HEADERS)
00021 //#include <iostream.h>
00022 //#else
00023 //#include <iostream>
00024 //#endif
00025 
00026 #include "util/PlatformUtils.hpp"
00027 #include "framework/LocalFileInputSource.hpp"
00028 
00029 
00030 
00031 #include "XalanDOM/XalanDocument.hpp"
00032 #include "XalanDOM/XalanElement.hpp"
00033 #include "XalanDOM/XalanNamedNodeMap.hpp"
00034 #include "XalanDOM/XalanNodeList.hpp"
00035 #include "DOMSupport/DOMServices.hpp"
00036 
00037 
00038 
00039 #include "XPath/XObject.hpp"
00040 #include "XPath/XPathEvaluator.hpp"
00041 #include "XPath/NodeRefListBase.hpp"
00042 
00043 
00044 
00045 #include "XalanSourceTree/XalanSourceTreeDOMSupport.hpp"
00046 #include "XalanSourceTree/XalanSourceTreeInit.hpp"
00047 #include "XalanSourceTree/XalanSourceTreeParserLiaison.hpp"
00048 
00049 #include <string.h>
00050 #include "global.h"
00051 #include "VTable.h"
00052 #include "Resource.h"
00053 
00054 
00055 const int MAX_XPATH_EXPR_LEN = 256;
00056 
00057 class XPathHelper {
00058 
00059 public:
00060 
00061         XPathHelper(void);
00062         int getVTableTree(VTable &v, const char * filename, 
00063                 const char * xpath, int *status);
00064         int getResourceTree(Resource &r, const char * filename, 
00065                 const char * xpath, int *status);
00066         
00067 
00068 private:
00069         
00070         int extractResourceInfo(XObjectPtr  xObj, Resource &r, int *status);
00071         int extractTableInfo(XObjectPtr node, VTable &v, int *status);
00072         int getTable(const XalanNode* node, VTable &v, int *status);
00073         int getFieldParam(const XalanNode *siblingNode, FieldParam *f, bool isField, int *status);
00074         int getLink(const XalanNode *siblingNode, Link &link, int *status);
00075         char* getDescription(const XalanNode *siblingNode, int *status);
00076         int getTableAttributes( const XalanNode *node, VTable &v, int *status);
00077         int getFieldParamAttributes(const XalanNode *node, FieldParam *f, bool isField, int * status);
00078         int getValuesAttributes(const XalanNode *node, Values &v, int * status);
00079         char * getCharString(XalanDOMString str);
00080         unsigned short * XPathHelper::getShortString(XalanDOMString str, int &size);
00081         int getValues(const XalanNode *node, Values &v, int *status);
00082         int getOptionAttributes(const XalanNode *node, Option &o, int *status);
00083         Range * getRange(const XalanNode *node, int *status);
00084         int getRows(const XalanNode *node, vector<Row> &r, const vector<Field> &fields, int *status);
00085         int getColumnAttributes(const XalanNode *node, Column &c, int *status);
00086         Range getRangeAttributes(const XalanNode *node, int *status);
00087         int getData(const XalanNode *node, TableData &td, const vector<Field> &fields, int *status);
00088         int getOption(const XalanNode *node, Option &o, int *status);
00089         int getRow(const XalanNode *node, Row &r, const vector<Field> &fields, int *status);
00090         int getColumn(const XalanNode *node, Column &c, bool isUnicode, int *status);
00091         int getResourceAttributes(const XalanNode *node, Resource &r, int *status);
00092         int getInfoAttributes(const XalanNode *node, Info &i, int *status);
00093         int getCoosysAttributes(const XalanNode *node, Coosys &c, int *status);
00094         int getResource(const XalanNode* node, Resource &r, int * status);
00095         int getInfo(const XalanNode *node, Info &i, int *status);
00096         int getCoosys(const XalanNode *node, Coosys &c, int *status);
00097         
00098 
00099 
00100 };
00101 
00102 
00103 #endif

Generated on Mon Jul 15 13:54:19 2002 for VOTable Parser 1.2 Documentation by doxygen1.2.16