当前位置: 首页>>代码示例>>C++>>正文


C++ XmlNode::getNodePointer方法代码示例

本文整理汇总了C++中XmlNode::getNodePointer方法的典型用法代码示例。如果您正苦于以下问题:C++ XmlNode::getNodePointer方法的具体用法?C++ XmlNode::getNodePointer怎么用?C++ XmlNode::getNodePointer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在XmlNode的用法示例。


在下文中一共展示了XmlNode::getNodePointer方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: sepa_CdtTrn_write_header

/* DR-2-023-245 
 * Write Pain.001 format. Fill header first*/
void sepa_CdtTrn_write_header(void) {
	XMLCh *tempStr = NULL;
	tempStr = XMLString::transcode("Document");
	cdtTrndoc = cdtTrnimpl->createDocument(0, tempStr, 0);
	DOMElement *document = cdtTrndoc->getDocumentElement();
	char msgId[20]={0};
	char day[10]={0};
	char time[20]={0};
	strncpy(day, gCr_file_t, 10);
	char *hour = &gCr_file_t[11];
 
	sprintf(msgId, "%10.010d%3.03d%6.06d", gCdtTrn_file_id, gServer_id,
			FILE_SEPA_EFT_OUT);
	sprintf(time, "%10.10sT%8.8s", day, hour);
	XmlNode documentNode(document,cdtTrndoc);
	documentNode.addAttribute("xmlns",gXmlns_str_credit);
	documentNode.addAttribute("xmlns:xsi",gXsi_str_credit);
	documentNode.addAttribute("xsi:schemaLocation",gSchemaLocation_str_credit);
	XmlNode rootNode = documentNode.addChild("CstmrCdtTrfInitn");
	cdtTrnroot = rootNode.getNodePointer();
	XmlNode headerNode = rootNode.addChild("GrpHdr");
	cdtTrnheader = headerNode.getNodePointer();
	headerNode.addChild("MsgId", msgId);
	headerNode.addChild("CreDtTm", time);
	headerNode.addChild("CtrlSum","0");
	headerNode.addChild("NbOfTxs", "0");
	headerNode.addChild("InitgPty").addChild("Nm", gCH_curr.frn_company_name);
}
开发者ID:huilang22,项目名称:Projects,代码行数:30,代码来源:eft_cr_xml.cpp

示例2: sepa_write_resc_detail

/*
*Transactions with same PmtInfId need to be grouped into same Payment Information block (enclosed by <PmtInf> and </PmtInf>).
*If same PmtInfId existed in document, then create new body tree(enclosed by <DrctDbtTxInf> and</ DrctDbtTxInf >) for payment transcrtion record, 
*otherwise, create entire new PmtInf tree 
*
*/
int sepa_write_resc_detail(void) {
	int counter = 0;
	XMLCh *tempStr = NULL;
	int errorCode = 1;
	DOMNode *pmtInf = NULL;
	tempStr = XMLString::transcode("PmtInfId");
	DOMNodeList* rootList = NULL;
	DOMNode* node = NULL;
	char temp[99]={0};
	try {
//		rootList = doc->getElementsByTagName(tempStr);
//		XMLString::release(&tempStr);
//		for (size_t i = 0; i < rootList->getLength(); ++i) {
//
//			node = rootList->item(i);
			sprintf(temp, "%10.010d%3.03d%4.4s%8.8s", gFile_id, gServer_id,
					gTrans.sequence_type, gTrans.payment_due_date);
			std::map<string,PmtInf*>::iterator it=PmtInfMap.find(temp);
			if (it != PmtInfMap.end() ){
			//tempStr = XMLString::transcode(temp);
		//	if (XMLString::equals(node->getTextContent(), tempStr)) {
		//		XMLString::release(&tempStr);
		//		pmtInf = node->getParentNode();
				create_PmtInf_body(it->second);
		//		counter++;
		//		break;
		//	}
		}else{

	//	if (counter == 0) {
			XmlNode rootNode(root,doc);
			XmlNode pmtInfNode = rootNode.addChild("PmtInf");
			pmtInf = pmtInfNode.getNodePointer();
			PmtInf *PmtOBj=new PmtInf();
			PmtOBj->setPmtInf_node(pmtInf);
			PmtInfMap.insert(std::make_pair(string(temp),PmtOBj));
			create_PmtInf_header(PmtOBj);
			create_PmtInf_body(PmtOBj);

		}
	} catch (const OutOfMemoryException&) {
		std::cout << "OutOfMemoryException" << std::endl;
		emit_bypass(FILE_LINE, (char*)"OutOfMemoryException");
		errorCode = 0;
	} catch (const DOMException& toCatch) {
		char *pMsg = XMLString::transcode(toCatch.getMessage());
		std::cout << "Error during Xerces-c Initialization.\n"
				<< "  Exception message:" << pMsg << std::endl;
		emit_bypass(FILE_LINE, pMsg);

		XMLString::release(&pMsg);
		errorCode = 0;
	}
	return (errorCode);

}
开发者ID:huilang22,项目名称:Projects,代码行数:62,代码来源:eft_cr_xml.cpp


注:本文中的XmlNode::getNodePointer方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。