Saxon/C  1.1.2
Saxon Processor library for C/C++/PHP
 All Classes Functions Variables
XdmNode.h
1 // Copyright (c) 2015 Saxonica Limited.
3 // This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
4 // If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
5 // This Source Code Form is "Incompatible With Secondary Licenses", as defined by the Mozilla Public License, v. 2.0.
7 
8 #ifndef SAXON_XDMNODE_h
9 #define SAXON_XDMNODE_h
10 
11 #include "XdmItem.h"
12 #include <string.h>
13 //#include "XdmValue.h"
14 
15 typedef enum eXdmNodeKind { DOCUMENT=9, ELEMENT=1, ATTRIBUTE=2, TEXT=3, COMMENT=8, PROCESSING_INSTRUCTION=7, NAMESPACE=13, UNKNOWN=0 } XDM_NODE_KIND;
16 
17 
18 
19 class XdmValue;
20 
21 class XdmNode : public XdmItem
22 {
23 
24 public:
25 
26 
27  /* XdmNode(const XdmValue& valuei){
28  //value = (sxnc_value *)malloc(sizeof(sxnc_value));
29  value = valuei.values[0]->getUnderlyingCValue();
30  xdmSize =1;
31  refCount = 1;
32  nodeKind = UNKNOWN;
33  }*/
34 
35  XdmNode(jobject);
36 
37  XdmNode(XdmNode *parent, jobject, XDM_NODE_KIND);
38 
39  virtual ~XdmNode(){
40  delete baseURI;
41  delete nodeName;
42 
43  //There might be potential issues with children and attribute node not being deleted when the parent node has been deleted
44  //we need to track this kind of problem.
45  }
46 
47  virtual bool isAtomic();
48 
49 
50  XDM_NODE_KIND getNodeKind();
51 
58  const char * getNodeName();
59 
60  const char* getBaseUri();
61 
62 
63  XdmValue * getTypedValue();
64 
65  XdmNode* getParent();
66 
67 
68  const char* getAttributeValue(const char *str);
69 
70  int getAttributeCount();
71 
72  XdmNode** getAttributeNodes();
73 
74  jobject getUnderlyingValue(){
75 
77 
78  }
79 
80 
81  XdmNode** getChildren();
82 
83  int getChildCount();
84 
88  XDM_TYPE getType(){
89  return XDM_NODE;
90  }
91 
92  // const char* getOuterXml();
93 
94 
95 
96 private:
97  const char * baseURI;
98  const char * nodeName;
99  XdmNode ** children; //caches child nodes when getChildren method is first called;
100  int childCount;
101  XdmNode * parent;
102  XdmNode ** attrValues;//caches attribute nodes when getAttributeNodes method is first called;
103  int attrCount;
104  XDM_NODE_KIND nodeKind;
105 
106 };
107 
108 #endif
const char * getNodeName()
Definition: XdmNode.cpp:34
XDM_TYPE getType()
Definition: XdmNode.h:88
Definition: XdmNode.h:21
Definition: XdmValue.h:44
Definition: XdmItem.h:15
jobject getUnderlyingValue()
Definition: XdmNode.h:74
virtual jobject getUnderlyingValue()
Definition: XdmItem.cpp:46