axis-c-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Samisa Abeysinghe <samisa_abeysin...@yahoo.com>
Subject Re: RE : Xerces 2.2.0 and empty tag
Date Fri, 09 Apr 2004 17:18:09 GMT
Hi Jean-Yves,
    I tied the pach you suggested to fix the empty tag bug. Unfortunately it di not work.
 
   The patch for attributes work. Thank you for that.
 
   I am working on the empty tag problem. At the moment it looks like we have to address this
at the deserializer level.
 
Thanks,
Samisa....
   

Jean-Yves Baudy <jy.baudy@free.fr> wrote:
Hi,

Here new patch which also include a fix for mutilple attributes in 
elements. It is possible that someone look at this code ASAP please (and 
commit it). This solve empty tag issue for me. But I can't test this :


Thanks,

Regards
--- c/src/soap/SoapParserXerces.cpp Mon Apr 5 17:05:20 2004
+++ src/soap/SoapParserXerces.cpp Thu Apr 8 13:06:04 2004
@@ -57,6 +57,9 @@
m_pParser->parseReset(token);
firstParsed = false;
}
+ 
+ Xhandler.ResetEmptyTag();
+ 
return 0;
}

@@ -67,19 +70,23 @@

int SoapParserXerces::GetStatus()
{
- m_nStatus = AXIS_SUCCESS; /*TODO:Check if an error occured in expat */
+ m_nStatus = AXIS_SUCCESS; /*TODO:Check if an error occured in xerces */
return m_nStatus;
}

const AnyElement* SoapParserXerces::Next()
{
-
if(!firstParsed)
{
m_pParser->parseFirst(*is, token);
firstParsed = true;
}

+ if ( Xhandler.GetEmptyTag() ) {
+ Xhandler.ResetEmptyTag();
+ return Xhandler.getAnyElement();
+ }
+ 
Xhandler.freeElement();
while (true)
{
--- c/src/soap/XercesHandler.cpp Mon Apr 5 17:05:55 2004
+++ src/soap/XercesHandler.cpp Thu Apr 8 13:23:01 2004
@@ -31,6 +31,7 @@
{
m_nStatus = AXIS_SUCCESS;
Nelement = (AnyElement*)malloc(sizeof (AnyElement));
+ m_nEmptyTag = 0; 
}

XercesHandler::~XercesHandler()
@@ -46,13 +47,19 @@

unsigned int len = attrs.getLength();
unsigned int index;
+ unsigned int i;
+ 
+ i=0;
+ 
for (index = 0; index < len*3; index+=3)
{ 
- Nelement->m_pchAttributes[index] = XMLString::transcode(attrs.getLocalName(index));
- Nelement->m_pchAttributes[index+1] = XMLString::transcode(attrs.getURI(index));
- Nelement->m_pchAttributes[index+2] = XMLString::transcode(attrs.getValue(index));
+ Nelement->m_pchAttributes[index] = XMLString::transcode(attrs.getLocalName(i));
+ Nelement->m_pchAttributes[index+1] = XMLString::transcode(attrs.getURI(i));
+ Nelement->m_pchAttributes[index+2] = XMLString::transcode(attrs.getValue(i));
+ i++;
}
Nelement->m_pchAttributes[len*3]=NULL;
+ m_nEmptyTag = 0; 
}

const XML_Ch* XercesHandler::NS4Prefix(const XML_Ch* prefix)
@@ -69,6 +76,7 @@
m_pCurrElement = Nelement;
Nelement->m_type = CHARACTER_ELEMENT;
Nelement->m_pchNameOrValue = XMLString::transcode(chars);
+ m_nEmptyTag = 0; 
}
void XercesHandler::ignorableWhitespace(const XMLCh* const chars, const unsigned int length)
{}
@@ -89,6 +97,10 @@

void XercesHandler::endElement (const XMLCh *const uri,const XMLCh *const localname,const
XMLCh *const qname)
{
+ if ( m_pCurrElement == Nelement )
+ m_nEmptyTag = 1;
+ else 
+ m_nEmptyTag = 0;
m_pCurrElement = Nelement;
Nelement->m_type = END_ELEMENT;
Nelement->m_pchNameOrValue = XMLString::transcode(localname);
--- c/src/soap/XercesHandler.h Thu Apr 1 17:02:52 2004
+++ src/soap/XercesHandler.h Thu Apr 8 09:01:41 2004
@@ -36,6 +36,9 @@
public :
void freeElement();
int GetStatus(){return m_nStatus;};
+ int GetEmptyTag(){return m_nEmptyTag;}; 
+ void ResetEmptyTag(){ m_nEmptyTag=0;}; 
+ 
// -----------------------------------------------------------------------
// Constructors
// -----------------------------------------------------------------------
@@ -72,6 +75,7 @@
void fatalError(const SAXParseException& exception);

int m_nStatus;
+ int m_nEmptyTag;
AnyElement * Nelement;
AnyElement * m_pCurrElement;



---------------------------------
Do you Yahoo!?
Yahoo! Small Business $15K Web Design Giveaway - Enter today
Mime
View raw message