Displaying XML-File in Webbrowser Control

S

Stropher

I have just created a Word document, saved it as XML-file.
Now I have created a WebBrowser-Control and would like to use it to
display the file, but how?
Could anyone give me some clues on how to do this?

Thanks in anticipation,
Stropher
 
N

Nick Hounsome

Stropher said:
I have just created a Word document, saved it as XML-file.
Now I have created a WebBrowser-Control and would like to use it to
display the file, but how?
Could anyone give me some clues on how to do this?

XML is not a display format.

The XML written by word can only be displayed (like a word doc) by word so
one way of acheiving your goal is to embed word in your form instead of a
webbrowser.

In principle you could create a style sheet (xslt) to convert it to HTML but
it would be v. hard work (is the XML "application" documented?)

The simplest way is just to save the file as HTML

[caveats: I really only know about XML/HTML/XSLT; I haven't got the latest
version of word; I'm not an expert on OLE]
 
S

Stropher

Thanks Nick for the quick answer..
I tried it this way
webBrowser1.Navigate(@"C:\temp\document.xml");
and it worked fine...

regards,
stropher
 
N

Nick Hounsome

Stropher said:
Thanks Nick for the quick answer..
I tried it this way
webBrowser1.Navigate(@"C:\temp\document.xml");
and it worked fine...

regards,
stropher

I'm curious - this should just show the nested XML structure rather than a
pretty document unless the xml already references a stylsheet.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top