易截截图软件、单文件、免安装、纯绿色、仅160KB

xml获取的节点名字不正确 - VC/MFC / 基础类

需要用到读取xml文件,获取参数。
  从网上下载一个xml读取程序,但是他获取的节点的名字不正确,他获取的节点名字都是“#text”:

#include "stdafx.h"  
#include <iostream>  
using namespace std; 
#include <msxml.h>  
#include <atlstr.h>  
#import "msxml.dll" raw_interfaces_only  

int _tmain(int argc, _TCHAR* argv[])  
{  
  ::CoInitialize(NULL);  
  CComPtr<MSXML::IXMLDOMDocument> spDoc;  
  HRESULT hr = spDoc.CoCreateInstance(__uuidof(MSXML::DOMDocument)); //创建文档对象 
  VARIANT_BOOL bFlag; 
  //hr = spDoc->load(CComVariant(L"BitComet.xml"), &bFlag); //load xml文件  
hr = spDoc->load(CComVariant(L"simple.xml"), &bFlag); //load xml文件  
//hr = spDoc->load(CComVariant(L"example.xml"), &bFlag); //load xml文件  
  CComPtr<MSXML::IXMLDOMElement> spElement;
  hr = spDoc->get_documentElement(&spElement); //获取根结点  
  CComBSTR strTagName;  
  hr = spElement->get_tagName(&strTagName);  
  wcout << "------TagName------" << endl;  
wcout <<(LPCTSTR) CString(str


相关问答:

vb读取用word转换成的xml里的数据 - VB / 基础类

Private Sub Command1_Click()
Dim MyString() As String
Open "a.xml" For Binary As #1 ' 打开刚创建的文件。
ReDim MyString(LOF(1) - 1)
  Put #1, , MyRecord ' 读入所有字符到变量中 ......

SQL server分解XML - MS-SQL Server / 应用实例

下面是XML初始文件内容
XML code:
<upd:Update xmlns:lar="http://schemas.microsoft.com/msus/2002/12/LogicalApplicabilityRules" xmlns:cmd="http://schemas.microsoft.com/msus/2002/12/Up ......

关于dom4j解析xml的小问题 - Java / Java相关

package com.javabean.xml;
import java.net.MalformedURLException;
import java.net.URL;
import org.dom4j.io.SAXReader;
import org.dom4j.Attribute;
import org.dom4j.Document;
import org.dom4j.Docum ......

XML压缩传输 - PowerBuilder / Web 应用

功能说明:Java servlet 把XML数据压缩后发送到PB用户端,PB收到数据后解压出来.
传输要经过Base64编码.
问题是:能收到数据但是解压不出来.想请教大家或者有什么好的办法?
PB可以用"zlibwapi.DLL" 解压
......

关于XML解析天气预报 - 移动平台 / Android

用SAX解析XML中,使用这段代码
String feed="http://www.google.com/ig/api?weather="+strCity; 
  URL url = new URL(feed.replace(" ", "%20"));  
......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号