473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Unable to view XML content generated on-the-fly in IE 6.0

Programming Language: C++, XML
Development Env: VS.net 2002
Platform Win2k, SP4
Browser: IE 6.0
XML Parser MSXML 4.0
---------------------------------------------

I have an XML file having around 1000 nodes under the root. Further, each
node may have several children. However, I am only interested in displaying
only one particular node, depending on the user choice, in IE.

1. So I have instantiated a IWebBrowser2* pBrowser interface and navigated
to about:blank. Then I extracted the IHTMLDocument2* interface from it.
2. Then I parsed the XML file and located the particular node to be
displayed using the XML DOM APIs.
3. Then I write the opening XML headers to the document using
IHTMLDocument2::write
4. Finally I use IXMLDOMNode::get_xml() to get the XML content in a BSTR.
After converting the BSTR to SAFEARRAY type I write to the browser document
using IHTMLDocument2::write.
5. Then I write the closing XML tag

Now comes the problem:
Nothing shows up in IE. If I do a view-source the XML is there.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

My question is: How do I show the generated XML in the same way we see it
when we open an XML file in IE without any attached XSL stylesheets?
--
Cheers,
[Rajiv Das]
Nov 11 '05 #1
1 3639
Rajiv Das wrote:
I have an XML file having around 1000 nodes under the root. Further, each
node may have several children. However, I am only interested in displaying
only one particular node, depending on the user choice, in IE.

1. So I have instantiated a IWebBrowser2* pBrowser interface and navigated
to about:blank. Then I extracted the IHTMLDocument2* interface from it.
2. Then I parsed the XML file and located the particular node to be
displayed using the XML DOM APIs.
3. Then I write the opening XML headers to the document using
IHTMLDocument2::write
4. Finally I use IXMLDOMNode::get_xml() to get the XML content in a BSTR.
After converting the BSTR to SAFEARRAY type I write to the browser document
using IHTMLDocument2::write.
5. Then I write the closing XML tag

Now comes the problem:
Nothing shows up in IE. If I do a view-source the XML is there.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^


You are wrinting XML text to IHTMLDocument object? I don't think that's
good idea. You have to write HTML representation of the XML.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: rahul | last post by:
i have configured a web server at port 8888. i have a .asp page which i want to view it through browser. something like http://localhost:8888/test.asp isnt working. please suggest me on how to do...
1
by: Headless | last post by:
Are character references allowed in generated content, in other words should they be parsed by a UA? (Opera does, Moz doesn't) Headless
5
by: Terje Sæternes | last post by:
It seems that this script wont run, any idea what I have don wrong+ Code----- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title>...
1
by: Morgan Cheng | last post by:
We can view MSIL code with reflector or ILDASM, but how can we view native code generated by JIT compiler at runtime?
0
by: Prabhua | last post by:
Can anyone tell me how to display folder content in tree view structure? if possible with radiobutton in each branches.
2
by: kashigal | last post by:
<? session_start(); require("db.php"); mysql_connect(MACHINE, USER, ''); mysql_select_db(DBNAME); $username = $_SESSION; $pwd =$_SESSION;
0
by: =?Utf-8?B?dGtz?= | last post by:
Hello, We are designing a web application (with .NET technologies) where we have to implement pay-per-view content functionality. It could be pay-per-page, pay-per-section or pay-per-time. I...
0
by: =?Utf-8?B?Ym9icGF0MTIz?= | last post by:
I cannot view my printer from control panel after clicking on printers and faxes and then view installed printers. Can anyone help.
0
by: =?Utf-8?B?QWxsYW4=?= | last post by:
I am unable to view pictures on some sites. Instead of photo, blank box with small red x in smaller box
1
by: nitdesh | last post by:
Hi , I have Just Registered to This Site and Deeply Require a Help For my Software . I am Into Warehousing Business I Have Front End as Visual Basic 6.0 and Backend as SQl 7.0 Database ...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.