🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.web
Article #1659

TCppWebBrowser doesn't return XML page ?

#1659
From: Peter
Date: Sat, 21 Aug 2004 19:37
67 lines
3163 bytes
Hi,

In the spirit of "don't invent the wheel a second time" a friend gave me a
piece of code that I'm trying to use but for the purpose I need it it
doesn't seem to work ?
I works 'nicely' for txt or html files with various content but the moment
the first line says :  <?xml version="1.0" ?> it doesn't work.

See code further in this post.

1) The moment the downloaded file contains <?xml version="1.0" ?> this line
of code fails :

if(SUCCEEDED(HTMLDocument->QueryInterface(IID_IPersistFile,(LPVOID*)&Persist
File)))
     and as you can see this way I cannot save the text to a temp file that
I'm using at the moment (for testing)
     Any idea how I can overcome this problem ?

2) The good-working situation worries me as well actually because I seem to
get an "interpreted" result back.
    In other words, when downloading a .html file all HTML tags and
decorations are gone !  Only filtered text remains.
    When I put the same text in a .txt file for instance I do get the
decorations.
    This leaves me a bit uneasy I can't rely on this as there may be
differences between brower version or additonal installations (maybe ??)
    I'm also never sure then that when they change something subtile on
server side I get something totally different from TCppWebBroweser than
before ??
    What I would like is the FULL and RAW text will all html or xml
decorations
    Can this be done and how ??

The code (cut to the essence) :

// ---
   bool BrowserStatus;
   IHTMLDocument2 *HTMLDocument = NULL;
   IPersistFile *PersistFile = NULL;

   if (!(!pCppWebBrowser->Busy && pOutputStrings && pCppWebBrowser->Document
&&
          String(pCppWebBrowser->LocationURL) != String("about:blank") &&
          SUCCEEDED(pCppWebBrowser->Document->QueryInterface(
          IID_IHTMLDocument2, (LPVOID*)&HTMLDocument))))
   {
      BrowserStatus=BROWSER_NOT_READY;
   }
   else
   {
      BrowserStatus=BROWSER_DATA_READY;


if(SUCCEEDED(HTMLDocument->QueryInterface(IID_IPersistFile,(LPVOID*)&Persist
File)))
      {

         // Save the file content to a temporary file
         PersistFile->Save(WideString(TempFile),false);
         PersistFile->Release();

      }
      else
      {
       }
// ---
Technical Details
Message-ID: <4127a516$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: feeec,7498d8e04b8d308a,start
X-Google-Attributes: gidfeeec,public
X-Google-Language: ENGLISH,ASCII-7-bit
Reply-To: "Peter" <Peter@Smart-Projects.net>
From: "Peter" <Peter@Smart-Projects.net>
Newsgroups: borland.public.cppbuilder.internet.web
Subject: TCppWebBrowser doesn't return XML page ?
Date: Sat, 21 Aug 2004 21:37:41 +0200
Lines: 69
Organization: www.Smart-Projects.net
X-Priority: 3
X-MSMail-Priority: Normal
X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
NNTP-Posting-Host: 213.118.45.8
Message-ID: <4127a516$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1093117206 213.118.45.8 (21 Aug 2004 12:40:06 -0700)
Path: arc1-ca.pugleaf.net!g2news1.google.com!news1.google.com!news.glorb.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail