如何通过 MSXML DOM 得到xml 文件的Encoding??
我在用 IXMLDOMDocumentPtr 时出现的问题
<?xml version="1.0" encoding="GBK"?><Response></Response>
IXMLDOMDocumentPtr m_DocPtr;
m_DocPtr->save(_variant_t(m_strFPath));
save方法把DOM 存为文件后 “encoding”存在
m_DocPtr->get_xml(&bStr)
get_xml方法把DOM 存为 BSTR 后 “encoding”不存在
<?xml version="1.0" ?><Response></Response>
怎样能得到带有“encoding”的 string;
问题点数:100、回复次数:5Top
1 楼robothn(雷鸟)回复于 2003-01-03 17:46:02 得分 0
up gzTop
2 楼vcvj([Reside]in Fuzhou, [Gonna]be Oversea, [Depositing)回复于 2003-01-03 17:48:37 得分 20
using ISAXContentHandler of SAX interface
SAX2
HRESULT processingInstruction(
.....
)
Top
3 楼xiyi168(风云)回复于 2003-01-03 18:05:14 得分 0
to: vcvj(Mr.wu)
这样不能达到我的要求,应为我现在 已经有了DOM 结构,
只想把它 转换为一个 string,
我查了parser sdk ,已经明确的讲了:get_xml方法 会把
encoding 转换 为 “Unicode”,
不知道那位有办法??Top
4 楼jiangsheng(蒋晟.Net[MVP])回复于 2003-01-03 20:49:37 得分 80
MSDN
XML General Technical Articles
How to Encode XML Data
By Chris Lovett
Microsoft Corporation
March 2000
Summary: This article explains how character encoding works and specifically how it works in XML and the MSXML DOM.
Top
5 楼xiyi168(风云)回复于 2003-01-06 10:06:12 得分 0
Thanks a lot for jiangsheng(蒋晟.Net)!!
I have looked for article you said ,
but this article say method "get_xml" get encoding is equal to "Unicode" .
结了!Top
相关问题
- MSXML DOM 4.0 如何搜索xml节点?
- msxml dom 的语法
- C++/DOM/MSXML下写出的XML文件会导致IE6.0崩溃,达人指教
- 请问用vc和DOM怎么写xml开始的版本信息version和encoding
- 我使用MSXML DOM创建XML文件,怎么在文件开头写上一些注释?
- 使用DOM如何创建xml文档的版本声明和编码方式,如<?xml version="1.0" encoding="gb2312"?>
- xml dom的问题
- JDK1.4 XML DOM API研究.
- Why this node and nodelist is needed in XML dom interface
- 一个dom xml问题




