[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 195
  • 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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