You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@santuario.apache.org by sc...@apache.org on 2009/09/01 02:49:42 UTC

svn commit: r809788 - in /xml/security/trunk/c/src: canon/XSECC14n20010315.cpp transformers/TXFMXPath.cpp transformers/TXFMXPathFilter.cpp transformers/TXFMXSL.cpp

Author: scantor
Date: Tue Sep  1 00:49:42 2009
New Revision: 809788

URL: http://svn.apache.org/viewvc?rev=809788&view=rev
Log:
Donated patches for newer Xalan support.

Modified:
    xml/security/trunk/c/src/canon/XSECC14n20010315.cpp
    xml/security/trunk/c/src/transformers/TXFMXPath.cpp
    xml/security/trunk/c/src/transformers/TXFMXPathFilter.cpp
    xml/security/trunk/c/src/transformers/TXFMXSL.cpp

Modified: xml/security/trunk/c/src/canon/XSECC14n20010315.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/canon/XSECC14n20010315.cpp?rev=809788&r1=809787&r2=809788&view=diff
==============================================================================
--- xml/security/trunk/c/src/canon/XSECC14n20010315.cpp (original)
+++ xml/security/trunk/c/src/canon/XSECC14n20010315.cpp Tue Sep  1 00:49:42 2009
@@ -34,6 +34,7 @@
 #include <xsec/utils/XSECSafeBufferFormatter.hpp>
 
 // Xerces includes
+#include <xercesc/dom/DOMElement.hpp>
 #include <xercesc/dom/DOMNamedNodeMap.hpp>
 #include <xercesc/util/XMLUniDefs.hpp>
 
@@ -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
 

Modified: xml/security/trunk/c/src/transformers/TXFMXPath.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/transformers/TXFMXPath.cpp?rev=809788&r1=809787&r2=809788&view=diff
==============================================================================
--- xml/security/trunk/c/src/transformers/TXFMXPath.cpp (original)
+++ xml/security/trunk/c/src/transformers/TXFMXPath.cpp Tue Sep  1 00:49:42 2009
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 The Apache Software Foundation.
+ * Copyright 2002-2009 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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;

Modified: xml/security/trunk/c/src/transformers/TXFMXPathFilter.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/transformers/TXFMXPathFilter.cpp?rev=809788&r1=809787&r2=809788&view=diff
==============================================================================
--- xml/security/trunk/c/src/transformers/TXFMXPathFilter.cpp (original)
+++ xml/security/trunk/c/src/transformers/TXFMXPathFilter.cpp Tue Sep  1 00:49:42 2009
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 The Apache Software Foundation.
+ * Copyright 2002-2009 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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;

Modified: xml/security/trunk/c/src/transformers/TXFMXSL.cpp
URL: http://svn.apache.org/viewvc/xml/security/trunk/c/src/transformers/TXFMXSL.cpp?rev=809788&r1=809787&r2=809788&view=diff
==============================================================================
--- xml/security/trunk/c/src/transformers/TXFMXSL.cpp (original)
+++ xml/security/trunk/c/src/transformers/TXFMXSL.cpp Tue Sep  1 00:49:42 2009
@@ -1,5 +1,5 @@
 /*
- * Copyright 2002-2005 The Apache Software Foundation.
+ * Copyright 2002-2009 The Apache Software Foundation.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -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