You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-commits@axis.apache.org by na...@apache.org on 2010/05/04 21:46:20 UTC
svn commit: r941013 - in /axis/axis1/c/trunk/src: soap/SoapDeSerializer.cpp
xml/AnyElement.h xml/xerces/XercesHandler.cpp
Author: nadiramra
Date: Tue May 4 19:46:20 2010
New Revision: 941013
URL: http://svn.apache.org/viewvc?rev=941013&view=rev
Log:
AXISCPP-1070 - Add support for element that references a schema
Modified:
axis/axis1/c/trunk/src/soap/SoapDeSerializer.cpp
axis/axis1/c/trunk/src/xml/AnyElement.h
axis/axis1/c/trunk/src/xml/xerces/XercesHandler.cpp
Modified: axis/axis1/c/trunk/src/soap/SoapDeSerializer.cpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/soap/SoapDeSerializer.cpp?rev=941013&r1=941012&r2=941013&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/soap/SoapDeSerializer.cpp (original)
+++ axis/axis1/c/trunk/src/soap/SoapDeSerializer.cpp Tue May 4 19:46:20 2010
@@ -2216,7 +2216,15 @@ getAnyObject (const AxisChar* pName, con
bool bElementFound = false;
AxisString xmlStr = "";
+
+ // There may have been namespace declarations that were previously processed....get it from
+ // the node and reset the node variable.
AxisString nsDecls = "";
+ if (m_pNode)
+ {
+ nsDecls = ((AnyElement*)m_pNode)->m_strXMLNSDeclsForAnyObject.c_str();
+ ((AnyElement*)m_pNode)->m_strXMLNSDeclsForAnyObject.clear();
+ }
stack <AxisString> nsPrefixStack;
@@ -2235,6 +2243,9 @@ getAnyObject (const AxisChar* pName, con
{
if (0 != strcmp (pName, m_pNode->m_pchNameOrValue))
{
+ // Need to save namespace string just in case it is needed later.
+ ((AnyElement*)m_pNode)->m_strXMLNSDeclsForAnyObject = nsDecls.c_str();
+
logExitWithPointer(NULL)
return (AnyType *)NULL;
Modified: axis/axis1/c/trunk/src/xml/AnyElement.h
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/xml/AnyElement.h?rev=941013&r1=941012&r2=941013&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/xml/AnyElement.h (original)
+++ axis/axis1/c/trunk/src/xml/AnyElement.h Tue May 4 19:46:20 2010
@@ -50,8 +50,16 @@ using namespace std;
* @enum XML_NODE_TYPE
* Enumeration that defines the SAX events that the AnyElement may contain
*/
-typedef enum { START_ELEMENT=0, CHARACTER_ELEMENT, END_ELEMENT,
- START_PREFIX, END_PREFIX, START_END_ELEMENT, UNKNOWN} XML_NODE_TYPE;
+typedef enum
+{
+ START_ELEMENT=0,
+ CHARACTER_ELEMENT,
+ END_ELEMENT,
+ START_PREFIX,
+ END_PREFIX,
+ START_END_ELEMENT,
+ UNKNOWN
+} XML_NODE_TYPE;
/**
* @struct AnyElement
@@ -97,6 +105,14 @@ typedef struct
* NULL it is understood as the end of attributes.
*/
const char* m_pchAttributes[MAX_NO_OF_ATTRIBUTES*3];
+
+ /**
+ * This is the namespace declarations for an element that has yet been processed but for which
+ * the namespace declarations have been consumed (which is the reason for this variable). See
+ * SoapDeserializer::getAnyObject().
+ */
+ std::string m_strXMLNSDeclsForAnyObject;
+
} AnyElement;
/*
@@ -133,4 +149,3 @@ class AnyElemntUtils
};
#endif
-
Modified: axis/axis1/c/trunk/src/xml/xerces/XercesHandler.cpp
URL: http://svn.apache.org/viewvc/axis/axis1/c/trunk/src/xml/xerces/XercesHandler.cpp?rev=941013&r1=941012&r2=941013&view=diff
==============================================================================
--- axis/axis1/c/trunk/src/xml/xerces/XercesHandler.cpp (original)
+++ axis/axis1/c/trunk/src/xml/xerces/XercesHandler.cpp Tue May 4 19:46:20 2010
@@ -235,6 +235,8 @@ freeElement()
}
else
{
+ m_pCurrElement->m_strXMLNSDeclsForAnyObject.clear();
+
// free all inner strings
if (m_pCurrElement->m_pchNameOrValue)
{