简体   繁体   中英

Web browser not displaying XML when run by user's server

I have built some software that will display an xml string that is retrieved from a database under certain conditions. This works fine on my machine but when it is installed on the users machine the web browser objects display nothing. I have no idea why this is happening as its working on my computer and all the other computers in the office, just not on this server where it needs to.

An example of the code I am using:

webDownloadedInstructDup.DocumentText = DuplicateXml;

Where DuplicateXML would be something like:

<?xml version="1.0" encoding="utf-8"?><shp xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"><instructions><instruction><id>12345678</id><Reference>123456</Reference><agent><tradeName>Example</tradeName><legalName>Example</legalName></instruction></instructions>

The actual code will be getting the xml from a database and then casting it to a string.

Although I don't think that its the code in this case as it works on all the machines I have tested it on except the server. I am thinking that maybe there is something that needs to be set on this server to allow the use of these web browsers.

例

The left is how it works normally and the right web browser is how it is on the server. Anyone got a suggestion?

Used a quick fix for this as there seems to be some kind of weird functionality with the Web Browser control.

The way I got around it was to use Rich Text Boxes instead, the text for that box was then set to the xml file which had gone through an xml formatter found here:

XML Formatter by Charles Prakash Dasari .

This isnt an ideal solution as I wanted to make it as readable as possible, as you can see from the example image above the Web Browser control does that quite well. This does however make it readable for the user, and allow them to pick out the information they need, so I'm going with this for now as a fix.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM