Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 197
  • Last Modified:

XML from IWebBrowser

The IWebBrowser is currently displaying an XML result page.  How do I retrieve the XML string from the document?
0
ramrocket
Asked:
ramrocket
  • 3
  • 2
1 Solution
 
ramrocketAuthor Commented:
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
 
KurtVonCommented:
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
 
ramrocketAuthor Commented:
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
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
KurtVonCommented:
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
 
ramrocketAuthor Commented:
it is because html tags occurs not only between html block but also between xml block.  
0
 
CetusMODCommented:
PAQed with points refunded (100)

CetusMOD
Community Support Moderator
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now