MSXML2读取属性值自动去掉末尾空格的有关问题
MSXML2读取属性值自动去掉末尾空格的问题
<root name="名称: ">
</root>
类似这种,属性name的值最后包含空格,有时是因为格式的需要必须含有空格
pName = (_bstr_t)pAttrItem->GetnodeTypedValue();
而用MSXML2的函数GetnodeTypedValue获取到的字串却自动去掉了末尾的空格
请问能否设置不要去掉空格
------解决方案--------------------
为什么不用getAttribute
<root name="名称: ">
</root>
类似这种,属性name的值最后包含空格,有时是因为格式的需要必须含有空格
pName = (_bstr_t)pAttrItem->GetnodeTypedValue();
而用MSXML2的函数GetnodeTypedValue获取到的字串却自动去掉了末尾的空格
请问能否设置不要去掉空格
------解决方案--------------------
为什么不用getAttribute
_variant_t vtUpdateTime = pElement->getAttribute(ATTR_TIME.c_str());
m_szUpdatetime = vtUpdateTime.bstrVal;