新书推介:《语义网技术体系》
作者:瞿裕忠,胡伟,程龚
   XML论坛     W3CHINA.ORG讨论区     计算机科学论坛     SOAChina论坛     Blog     开放翻译计划     新浪微博  
 
  • 首页
  • 登录
  • 注册
  • 软件下载
  • 资料下载
  • 核心成员
  • 帮助
  •   Add to Google

    >> 本版讨论DOM, SAX, XPath等。
    [返回] 中文XML论坛 - 专业的XML技术讨论区XML.ORG.CN讨论区 - XML技术『 DOM/SAX/XPath 』 → [求助]VC下,如何用Xerces C++从内存中的DOMDocument创建xml文件? 查看新帖用户列表

      发表一个新主题  发表一个新投票  回复主题  (订阅本版) 您是本帖的第 4028 个阅读者浏览上一篇主题  刷新本主题   树形显示贴子 浏览下一篇主题
     * 贴子主题: [求助]VC下,如何用Xerces C++从内存中的DOMDocument创建xml文件? 举报  打印  推荐  IE收藏夹 
       本主题类别:     
     chrissie_lucky 美女呀,离线,快来找我吧!
      
      
      等级:大一新生
      文章:0
      积分:55
      门派:XML.ORG.CN
      注册:2005/4/13

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给chrissie_lucky发送一个短消息 把chrissie_lucky加入好友 查看chrissie_lucky的个人资料 搜索chrissie_lucky在『 DOM/SAX/XPath 』的所有贴子 引用回复这个贴子 回复这个贴子 查看chrissie_lucky的博客楼主
    发贴心情 [求助]VC下,如何用Xerces C++从内存中的DOMDocument创建xml文件?

    ........................

               char* goutputfile="D:\\result.xml";

               XMLCh tempStr[100];
                XMLString::transcode("LS", tempStr, 99);
                DOMImplementation *impl          = DOMImplementationRegistry::getDOMImplementation(tempStr);
                DOMWriter         *theSerializer = ((DOMImplementationLS*)impl)->createDOMWriter();

                //
                // Plug in a format target to receive the resultant
                // XML stream from the serializer.
                //
                // StdOutFormatTarget prints the resultant XML stream
                // to stdout once it receives any thing from the serializer.
                //
                XMLFormatTarget *myFormTarget;
                if (goutputfile)
                    myFormTarget = new LocalFileFormatTarget(goutputfile);
                else
                    myFormTarget = new StdOutFormatTarget();

                // get the DOM representation
                DOMNode *doc = parser->getDocument();

                //
                // do the serialization through DOMWriter::writeNode();
                //
                theSerializer->writeNode(myFormTarget, *doc);

                delete theSerializer;
    ...............................................

    这样写系统报错,不知正确的应该怎么写?
    请指教,谢谢


       收藏   分享  
    顶(0)
      




    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/5/4 8:41:00
     
     congtou123 帅哥哟,离线,有人找我吗?
      
      
      等级:大一新生
      文章:0
      积分:54
      门派:XML.ORG.CN
      注册:2005/5/20

    姓名:(无权查看)
    城市:(无权查看)
    院校:(无权查看)
    给congtou123发送一个短消息 把congtou123加入好友 查看congtou123的个人资料 搜索congtou123在『 DOM/SAX/XPath 』的所有贴子 引用回复这个贴子 回复这个贴子 查看congtou123的博客2
    发贴心情 
    我按照你的代码写了一下,可以用的。
    能不能把具体出了什么错写出来。
    点击查看用户来源及管理<br>发贴IP:*.*.*.* 2005/5/21 1:08:00
     
     GoogleAdSense
      
      
      等级:大一新生
      文章:1
      积分:50
      门派:无门无派
      院校:未填写
      注册:2007-01-01
    给Google AdSense发送一个短消息 把Google AdSense加入好友 查看Google AdSense的个人资料 搜索Google AdSense在『 DOM/SAX/XPath 』的所有贴子 访问Google AdSense的主页 引用回复这个贴子 回复这个贴子 查看Google AdSense的博客广告
    2024/5/2 7:52:42

    本主题贴数2,分页: [1]

    管理选项修改tag | 锁定 | 解锁 | 提升 | 删除 | 移动 | 固顶 | 总固顶 | 奖励 | 惩罚 | 发布公告
    W3C Contributing Supporter! W 3 C h i n a ( since 2003 ) 旗 下 站 点
    苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
    8,062.500ms