XML from IWebBrowser

Posted on 2006-06-30
Last Modified: 2013-11-20
The IWebBrowser is currently displaying an XML result page.  How do I retrieve the XML string from the document?
Question by:ramrocket
  • 3
  • 2

Author Comment

ID: 17020625
CComBSTR bstrInnerHTML;
CString result = W2A(bstrInnerHTML);

When I get the response from from an http request, I get in the result:

<html>...<?xml version="1.0" encoding="utf-8" ?>...</html>

How do I get rid of html tags and just get the xml string???
LVL 11

Expert Comment

ID: 17026285
get_innerHTML isn't working?  You may have to navigate to the specific element in the XML (I can't tell from what you've posted).

Another possibility is to reparse the string into a DOMDocument and then use standard XML navigation to get to the part you want.

Hope this helps.

Author Comment

ID: 17030668
thanks Kurt, I've figured it out.  I have to write a little parsing function and painfully parse the string in memory to get rid of hltml tags.

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

LVL 11

Expert Comment

ID: 17031758
I'm surprised you can't trim the string before the start and after the end of the XML tags, then feed the string to a DOMDocument to get it parsed automatically.

Author Comment

ID: 17031808
it is because html tags occurs not only between html block but also between xml block.  

Accepted Solution

CetusMOD earned 0 total points
ID: 17371184
PAQed with points refunded (100)

Community Support Moderator

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
VB.NET how to use the Vertical ScrollBar 5 103
cat dog challenge 18 124
Smart Camera scanning and reading information 3 106
Is there a simple front-end menu system. 9 90
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question