MSXML DOM save problem 
Author Message
 MSXML DOM save problem

I have been trying different ways to save the xml created from DOM for
a few days now. There seems to be a bug in MSXML to save it to a
string or a file. I have also tried saving it to a IStream. MSXML
seems to like it but the file created have other bytes ion it which
due with the class IStream itself and can not be used like a normal
XML file.

Can anybody tell me any other ways to overcome this problem or can
anyone show me how to use the IStream and IStorage probably so it can
be use like a normal XML file?

This is what I used to create the storage and stream.
if (StgCreateDocfile(_T("Output.xml"), STGM_WRITE |
STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0 , &pStg) == S_OK)
{
    if (pStg->CreateStream(_T("Stm"), STGM_CREATE | STGM_WRITE |
STGM_SHARE_EXCLUSIVE, 0, 0, &pStream) == S_OK)
                {
                        _variant_t varOutput (pStream);
                        hr = pXMLDoc->save(varOutput);
                        if(!SUCCEEDED(hr))
                                return 0;
                        pStream->Release();
                }
                pStg->Release();
        }



Fri, 28 Jan 2005 15:54:22 GMT  
 MSXML DOM save problem
see whether KB Q301935    can help you,

Ashley Antony Elenjickal
Devp  Support - Windows Embedded
Microsoft Corporation

This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------

| Newsgroups: microsoft.public.windowsce.embedded.vc
| Subject: MSXML DOM save problem
| Date: 12 Aug 2002 00:54:22 -0700
| Organization: http://groups.google.com/
| Lines: 26

| NNTP-Posting-Host: 202.138.10.132
| Content-Type: text/plain; charset=ISO-8859-1
| Content-Transfer-Encoding: 8bit
| X-Trace: posting.google.com 1029138862 6042 127.0.0.1 (12 Aug 2002
07:54:22 GMT)

| NNTP-Posting-Date: 12 Aug 2002 07:54:22 GMT
| Path:
cpmsftngxa07!cpmsftngxa08!tkmsftngp01!newsfeed00.sul.t-online.de!t-online.de
!colt.net!news-lond.gip.net!news-raspail.gip.net!news.gsl.net!gip.net!fr.cla
ra.net!heighliner.fr.clara.net!isdnet!sn-xit-02!sn-xit-01!sn-xit-04!supernew
s.com!postnews1.google.com!not-for-mail
| Xref: cpmsftngxa07 microsoft.public.windowsce.embedded.vc:15282
| X-Tomcat-NG: microsoft.public.windowsce.embedded.vc
|
| I have been trying different ways to save the xml created from DOM for
| a few days now. There seems to be a bug in MSXML to save it to a
| string or a file. I have also tried saving it to a IStream. MSXML
| seems to like it but the file created have other bytes ion it which
| due with the class IStream itself and can not be used like a normal
| XML file.
|
| Can anybody tell me any other ways to overcome this problem or can
| anyone show me how to use the IStream and IStorage probably so it can
| be use like a normal XML file?
|
| This is what I used to create the storage and stream.
| if (StgCreateDocfile(_T("Output.xml"), STGM_WRITE |
| STGM_SHARE_EXCLUSIVE | STGM_CREATE, 0 , &pStg) == S_OK)
| {
|     if (pStg->CreateStream(_T("Stm"), STGM_CREATE | STGM_WRITE |
| STGM_SHARE_EXCLUSIVE, 0, 0, &pStream) == S_OK)
|               {
|                       _variant_t varOutput (pStream);
|                       hr = pXMLDoc->save(varOutput);
|                       if(!SUCCEEDED(hr))
|                               return 0;
|                       pStream->Release();
|               }
|               pStg->Release();
|       }
|



Sat, 29 Jan 2005 10:48:44 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. MSXML, DOM, and XPath filters

2. pocket pc msxml save() problem

3. Help request: IStream implementation for saving objects into XML DOM Documents

4. XML DOM problem

5. NEWBIE calling ATL gods: Problem in calling DOM object

6. XML DOM Problem

7. MSXML problem.

8. Problems with MSXML

9. XML DOM via c#/.net

10. DOM vs XML Namespace

11. XML DOM and .NET's XML classes

12. IE DOM in .NET

 

 
Powered by phpBB® Forum Software