00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef XSECC14n20010315_INCLUDE
00030 #define XSECC14n20010315_INCLUDE
00031
00032
00033 #include <xsec/framework/XSECDefs.hpp>
00034 #include <xsec/utils/XSECSafeBuffer.hpp>
00035 #include <xsec/utils/XSECXPathNodeList.hpp>
00036 #include <xsec/canon/XSECCanon.hpp>
00037
00038 #include <xercesc/framework/XMLFormatter.hpp>
00039
00040
00041 #include <memory.h>
00042 #include <vector>
00043
00044 XSEC_USING_XERCES(XMLFormatter);
00045 XSEC_USING_XERCES(XMLFormatTarget);
00046
00047 class XSECSafeBufferFormatter;
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058 struct XSECNodeListElt {
00059
00060 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *element;
00061 safeBuffer sortString;
00062
00063 XSECNodeListElt *next,
00064 *last;
00065
00066 };
00067
00068
00069
00070 #define XMLNS_PREFIX "a"
00071 #define ATTRIBUTE_PREFIX "b"
00072
00073 #define NOURI_PREFIX "a"
00074 #define HAVEURI_PREFIX "b"
00075
00076
00077
00078
00079
00080 class CANON_EXPORT XSECC14n20010315 : public XSECCanon {
00081
00082 #if defined(XALAN_NO_NAMESPACES)
00083 typedef vector<char *> CharListVectorType;
00084 #else
00085 typedef std::vector<char *> CharListVectorType;
00086 #endif
00087
00088 #if defined(XALAN_SIZE_T_IN_NAMESPACE_STD)
00089 typedef std::size_t size_type;
00090 #else
00091 typedef size_t size_type;
00092 #endif
00093
00094
00095 public:
00096
00097
00098 XSECC14n20010315();
00099 XSECC14n20010315(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc);
00100 XSECC14n20010315(XERCES_CPP_NAMESPACE_QUALIFIER DOMDocument *newDoc,
00101 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *newStartNode);
00102 virtual ~XSECC14n20010315();
00103
00104
00105
00106 int XPathSelectNodes(const char * XPathExpr);
00107 void setXPathMap(const XSECXPathNodeList & map);
00108
00109
00110 void setCommentsProcessing(bool onoff);
00111 bool getCommentsProcessing(void);
00112
00113
00114 void setExclusive(void);
00115 void setExclusive(char * xmlnsList);
00116
00117 protected:
00118
00119
00120 int processNextNode();
00121
00122
00123 bool inNonExclNSList(safeBuffer &ns);
00124
00125 private:
00126
00127 void XSECC14n20010315::init();
00128 bool checkRenderNameSpaceNode(XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *e,
00129 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode *a);
00130
00131
00132 XSECSafeBufferFormatter * mp_formatter;
00133 safeBuffer m_formatBuffer;
00134
00135
00136 XSECNodeListElt * mp_attributes,
00137 * mp_currentAttribute,
00138 * mp_firstNonNsAttribute;
00139 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_attributeParent;
00140 bool m_returnedFromChild;
00141 XERCES_CPP_NAMESPACE_QUALIFIER DOMNode * mp_firstElementNode;
00142 bool m_firstElementProcessed;
00143 unsigned char * mp_charBuffer;
00144
00145
00146 bool m_XPathSelection;
00147 XSECXPathNodeList m_XPathMap;
00148
00149
00150 bool m_processComments;
00151
00152
00153 CharListVectorType m_exclNSList;
00154 bool m_exclusive;
00155 bool m_exclusiveDefault;
00156
00157
00158
00159 };
00160
00161
00162 #endif
00163
00164