summaryrefslogtreecommitdiff
blob: b5d14241584567112f85236cea0962fa885c93ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
diff -Naur xml-security-c-1.5.1.orig/src/canon/XSECC14n20010315.cpp xml-security-c-1.5.1/src/canon/XSECC14n20010315.cpp
--- xml-security-c-1.5.1.orig/src/canon/XSECC14n20010315.cpp	2009-07-27 09:23:51.228693118 +0200
+++ xml-security-c-1.5.1/src/canon/XSECC14n20010315.cpp	2009-07-27 11:37:12.697101082 +0200
@@ -36,6 +36,7 @@
 // Xerces includes
 #include <xercesc/dom/DOMNamedNodeMap.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
+#include <xercesc/dom/DOMElement.hpp>
 
 XERCES_CPP_NAMESPACE_USE
 
@@ -61,7 +62,7 @@
 XALAN_USING_XALAN(NodeRefList)
 XALAN_USING_XALAN(XercesDocumentWrapper)
 XALAN_USING_XALAN(XercesWrapperNavigator)
-
+XALAN_USING_XALAN(c_wstr)
 
 #endif
 
@@ -450,21 +451,27 @@
 
 	// We use Xalan to process the Xerces DOM tree and get the XPath nodes
 
+#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
+	XercesParserLiaison theParserLiaison;
+	XercesDOMSupport theDOMSupport(theParserLiaison);
+#else
 	XercesDOMSupport theDOMSupport;
 #if defined XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT
 	XercesParserLiaison theParserLiaison(theDOMSupport);
 #else
 	XercesParserLiaison theParserLiaison;
 #endif
+#endif // XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
 
 	if (mp_doc == 0) {
 		throw XSECException(XSECException::UnsupportedFunction,
 			"XPath selection only supported in C14n for full documents");
 	}
-	XalanDocument* theDoc = theParserLiaison.createDocument(mp_doc);
 
-	XalanElement * xe = theDoc->createElement(XalanDOMString("ns"));
-	xe->setAttribute(/*XalanDOMString(""), */XalanDOMString("xmlns:ietf"), XalanDOMString("http://www.ietf.org"));
+	DOMElement* theXercesNode = mp_doc->createElement(c_wstr(XalanDOMString("ns")));
+	theXercesNode->setAttribute(c_wstr(XalanDOMString("xmlns:ietf")), c_wstr(XalanDOMString("http://www.ietf.org")));
+
+	XalanDocument* theDoc = theParserLiaison.createDocument(mp_doc);
 
 	// Set up the XPath evaluator
 
@@ -505,7 +512,7 @@
 		theDOMSupport,
 		theContextNode,
 		expr,
-		xe));
+		theDoc->getElementById(XalanDOMString("ns"))));
 
 #else
 
@@ -514,7 +521,7 @@
 		theDOMSupport,
 		theContextNode,
 		expr,
-		xe));
+		theDoc->getElementById(XalanDOMString("ns"))));
 		//theDoc->getDocumentElement()));
 #endif
 
diff -Naur xml-security-c-1.5.1.orig/src/transformers/TXFMXPath.cpp xml-security-c-1.5.1/src/transformers/TXFMXPath.cpp
--- xml-security-c-1.5.1.orig/src/transformers/TXFMXPath.cpp	2009-07-27 09:23:51.254551633 +0200
+++ xml-security-c-1.5.1/src/transformers/TXFMXPath.cpp	2009-07-27 11:40:30.923733630 +0200
@@ -283,8 +283,12 @@
 	setXPathNS(document, XPathAtts, addedNodes, formatter, mp_nse);
 
 	XPathProcessorImpl	xppi;					// The processor
-	XercesDOMSupport	xds;
 	XercesParserLiaison xpl;
+#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
+	XercesDOMSupport	xds(xpl);
+#else
+	XercesDOMSupport	xds;
+#endif
 	XPathEvaluator		xpe;
 	XPathFactoryDefault xpf;
 	XPathConstructionContextDefault xpcc;
diff -Naur xml-security-c-1.5.1.orig/src/transformers/TXFMXPathFilter.cpp xml-security-c-1.5.1/src/transformers/TXFMXPathFilter.cpp
--- xml-security-c-1.5.1.orig/src/transformers/TXFMXPathFilter.cpp	2009-07-27 09:23:51.254551633 +0200
+++ xml-security-c-1.5.1/src/transformers/TXFMXPathFilter.cpp	2009-07-27 11:39:11.073713584 +0200
@@ -183,8 +183,12 @@
 	setXPathNS(document, expr->mp_NSMap, addedNodes, mp_formatter, mp_nse);
 
 	XPathProcessorImpl	xppi;					// The processor
-	XercesDOMSupport	xds;
 	XercesParserLiaison xpl;
+#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
+	XercesDOMSupport	xds(xpl);
+#else
+	XercesDOMSupport	xds;
+#endif
 	XPathEvaluator		xpe;
 	XPathFactoryDefault xpf;
 	XPathConstructionContextDefault xpcc;
diff -Naur xml-security-c-1.5.1.orig/src/transformers/TXFMXSL.cpp xml-security-c-1.5.1/src/transformers/TXFMXSL.cpp
--- xml-security-c-1.5.1.orig/src/transformers/TXFMXSL.cpp	2009-07-27 09:23:51.257885228 +0200
+++ xml-security-c-1.5.1/src/transformers/TXFMXSL.cpp	2009-07-27 11:42:31.867031516 +0200
@@ -102,11 +102,15 @@
 
 TXFMXSL::TXFMXSL(DOMDocument *doc) : 
 	TXFMBase(doc),
+#if XALAN_VERSION_MAJOR == 1 && XALAN_VERSION_MINOR > 10
+xds(xpl)
+#else
 #if defined XSEC_XERCESPARSERLIAISON_REQS_DOMSUPPORT
 xpl(xds) 
 #else
 xpl()
 #endif
+#endif
 {
 
 	// Zeroise all the pointers