Beispiel #1
0
UT_Error OXML_Element::serialize(IE_Exp_OpenXML* exporter)
{
    UT_Error ret = UT_OK;
    //Do something here when export filter is implemented

    if (ret != UT_OK)
        return ret;

    return serializeChildren(exporter);
}
Beispiel #2
0
int HeaderBlock::serialize(SoapSerializer& pSZ)
{
	#ifdef ENABLE_AXISTRACE
		if (axiscpp::AxisTrace::isTraceOn())
			axiscpp::AxisTrace::traceEntry("HeaderBlock", "serialize", this, 1,
					TRACETYPE_DATA, sizeof(SoapSerializer&), ((void*)&pSZ));	  /* AUTOINSERTED TRACE */
	#endif

	
    /*
     *In the code we don't look whether the m_sPrefix is available or
     *    not. Instead directly insert it. The reason is that the SOAP
     *  1.1 spec says that "All immediate child elements of the SOAP 
     *  Header element MUST be namespace-qualified".
     */
    int iStatus= AXIS_SUCCESS;
    list<AxisChar*> lstTmpNameSpaceStack;
    bool blnIsNewNamespace = false;
    do
    {
        /*
         * TO DO: ReWrite the following logic to deal with name spaces
         */
        pSZ.serialize("<", NULL);
        if(m_sPrefix.length() == 0)
        {
            m_sPrefix = pSZ.getNamespacePrefix(m_uri.c_str(),
                blnIsNewNamespace);
            if (blnIsNewNamespace)
            {
                lstTmpNameSpaceStack.push_back((AxisChar*)m_uri.c_str());
            }
        } else {
			/* The use has specified his/her own prefix. Therefore this is 
			taken as a new namespace and will be declared as a namespace 
			declaration.
			*/
			blnIsNewNamespace = true;
			/* Adding to the Serializers namespace list b'cas the child 
			elements of this HeaderBlock might use this namespace, so that they
			can get the correct corrosponding prefix from the Serializer.
			 */
			pSZ.addNamespaceToNamespaceList(m_uri.c_str(), m_sPrefix.c_str());
			/* Adding this namespace to the temprory namespace list b'cas we
			have to remove this namespce from the Serializer at the end of this
			HeaderBlock serialization.
			*/
			lstTmpNameSpaceStack.push_back((AxisChar*)m_uri.c_str());
		}
        pSZ.serialize(m_sPrefix.c_str(), ":", m_localname.c_str(), NULL);
		
		if (blnIsNewNamespace) {
			pSZ.serialize(" xmlns:", m_sPrefix.c_str(), "=\"", m_uri.c_str(), "\"", NULL);
		}
        iStatus= attrSerialize(pSZ, lstTmpNameSpaceStack);
        if(iStatus==AXIS_FAIL)
        {
            break;
        }
        iStatus= serializeNamespaceDecl(pSZ, lstTmpNameSpaceStack);
        if(iStatus==AXIS_FAIL)
        {
            break;
        }
        
        pSZ.serialize(">", NULL);
        iStatus= serializeChildren(pSZ, lstTmpNameSpaceStack);
        if(iStatus==AXIS_FAIL)
        {
            break;
        }
        pSZ.serialize("</", m_sPrefix.c_str(), ":", m_localname.c_str(), ">",
            NULL);
        /*
         * Removing the namespace list of this headerblock from the stack.
         */
        list<AxisChar*>::iterator itCurrentNamespace = 
            lstTmpNameSpaceStack.begin();
        while (itCurrentNamespace != lstTmpNameSpaceStack.end())
        {
            pSZ.removeNamespacePrefix(*itCurrentNamespace);
            itCurrentNamespace++;
        }
            
    } while(0);
	m_sPrefix = "";
    	{
		#ifdef ENABLE_AXISTRACE
			int traceRet = (iStatus);
			if (axiscpp::AxisTrace::isTraceOn())
				axiscpp::AxisTrace::traceExit("HeaderBlock", "serialize", this, 0,
					TRACETYPE_INT, 0, ((void*)&traceRet));	  /* AUTOINSERTED TRACE */
			return traceRet;
		#else
			return iStatus;
		#endif
	}

}