Solved

XML from IWebBrowser

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

Author Comment

by:ramrocket
Comment Utility
CComBSTR bstrInnerHTML;
pBody->get_outerHTML(&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???
0
 
LVL 11

Expert Comment

by:KurtVon
Comment Utility
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.
0
 

Author Comment

by:ramrocket
Comment Utility
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.

0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 11

Expert Comment

by:KurtVon
Comment Utility
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.
0
 

Author Comment

by:ramrocket
Comment Utility
it is because html tags occurs not only between html block but also between xml block.  
0
 

Accepted Solution

by:
CetusMOD earned 0 total points
Comment Utility
PAQed with points refunded (100)

CetusMOD
Community Support Moderator
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
How to determine file rename from EventLog ? 2 36
has77  challenge 9 67
MaxSpan challenge 9 65
Path of Workbook 3 44
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
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…
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.
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

743 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now