修改tinyxml让其支持解析特殊字符

通过修改tinyxmlparser.cpp文件,扩展了TinyXML库的实体数组,添加了对希腊字母λ, Φ, η的支持,使其能正确解析包含这些特殊字符的XML文档。" 136034954,15828125,RT-DETR与SENetV2:提升目标检测性能,"['深度学习', '计算机视觉', '目标检测', 'RT-DETR', '卷积神经网络']
摘要由CSDN通过智能技术生成

修改tinyxmlparser.cpp文件中的部分代码如下:

TiXmlBase::Entity TiXmlBase::entity[ NUM_ENTITY ] = 
{
    { "&",  5, "&" },
    { "&lt;",   4, "<" },
    { "&gt;",   4, ">" },
    { "&quot;", 6, "\"" },
    { "&apos;", 6, "\'" },
    { "&\#955;", 6, "λ" },
    { "&\#934;", 6, "Φ" },
    { "&\#951;", 6, "η" }
};

const char* TiXmlBase::GetEntity( const char* p, char* value, int* length, TiXmlEncoding encoding )
{
	// Presume an entity, and pull it out.
    TIXML_STRING ent;
	int i;
	*length = 0;

    // Now try to match it.
	for( i=0; i<NUM_ENTITY; ++i )
	{
		if ( strncmp( entity[i].str, p, entity[i].strLength ) == 0 )
		{
			assert( strlen( entity[
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值