axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sam...@apache.org
Subject cvs commit: ws-axis/c/src/xml/xerces XercesHandler.cpp
Date Wed, 13 Oct 2004 04:51:54 GMT
samisa      2004/10/12 21:51:54

  Modified:    c/src/xml/xerces XercesHandler.cpp
  Log:
  Included logic to handle '>' and '<' in strings.
  Fix for Jira AXISCPP-184
  
  Revision  Changes    Path
  1.7       +21 -1     ws-axis/c/src/xml/xerces/XercesHandler.cpp
  
  Index: XercesHandler.cpp
  ===================================================================
  RCS file: /home/cvs/ws-axis/c/src/xml/xerces/XercesHandler.cpp,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- XercesHandler.cpp	28 Jun 2004 07:26:40 -0000	1.6
  +++ XercesHandler.cpp	13 Oct 2004 04:51:54 -0000	1.7
  @@ -100,9 +100,29 @@
   void XercesHandler::characters(const XMLCh* const chars, 
                                  const unsigned int length)
   {
  +    const char* cp_PreviousNameOrValue = NULL;
  +    if( m_pCurrElement && m_pCurrElement->m_pchNameOrValue)
  +    {
  +        if (m_pCurrElement->m_type == CHARACTER_ELEMENT)
  +            cp_PreviousNameOrValue = m_pCurrElement->m_pchNameOrValue;
  +    }
       m_pCurrElement = m_pNextElement;
       m_pNextElement->m_type = CHARACTER_ELEMENT;
  -    m_pNextElement->m_pchNameOrValue = XMLString::transcode(chars);
  +    
  +    if (cp_PreviousNameOrValue)
  +    {
  +        char* cp_CurrentNameOrValue = XMLString::transcode(chars);
  +        char* cp_FullNameOrValue  = (char*) malloc(strlen(cp_PreviousNameOrValue) + strlen(cp_CurrentNameOrValue)
+ 1);
  +        cp_FullNameOrValue[0] = '\0'; 
  +        strcat(cp_FullNameOrValue, cp_PreviousNameOrValue);
  +        strcat(cp_FullNameOrValue, cp_CurrentNameOrValue);
  +        m_pNextElement->m_pchNameOrValue = (const char*)cp_FullNameOrValue;
  +        free(const_cast <char*> (cp_PreviousNameOrValue));
  +        free(cp_CurrentNameOrValue);
  +    }
  +    else
  +        m_pNextElement->m_pchNameOrValue = XMLString::transcode(chars);
  +    
   }
   void XercesHandler::ignorableWhitespace(const XMLCh* const chars, 
                                           const unsigned int length)
  
  
  

Mime
View raw message