mikha
asked on
write XML response results to a web browser
say, I have an XML response file from a third party web service.
This contains a result of some operation which, I need to display it to a client. this third party has also provided me with css and javascript files, which I use to display the response XML in a web browser.
my question is how can i write back a XML file to a web browser?
This contains a result of some operation which, I need to display it to a client. this third party has also provided me with css and javascript files, which I use to display the response XML in a web browser.
my question is how can i write back a XML file to a web browser?
ASKER
thanks @HainKurt.
I get following error, when I do response.write(result) -> Error parsing near '<?xml version="1.0" '.
sample response XML
<?xml version="1.0"?>
<ABCServiceResponse xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<ABCResults>
...
</ABCResults>
</ABCServiceResponse>
I get following error, when I do response.write(result) -> Error parsing near '<?xml version="1.0" '.
sample response XML
<?xml version="1.0"?>
<ABCServiceResponse xmlns:xsd = "http://www.w3.org/2001/XMLSchema" xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance">
<ABCResults>
...
</ABCResults>
</ABCServiceResponse>
what do you have here
and how do you want to show it on page?
and what language are you usşng? vb or c#?
<ABCResults>
... ???
</ABCResults>
and how do you want to show it on page?
and what language are you usşng? vb or c#?
if you want to show xml as is
try this:
https://jsfiddle.net/pgss8v94/
try this:
<textarea cols=80 rows=10>
<%=result%>
</textarea>
https://jsfiddle.net/pgss8v94/
ASKER
@HainKurt - the third party has provided me with, js and css files. if I include those and open their response sample file using a browser, the results displays.
so, I was thinking may be I can open the XML response file in a different tab in a browser, while that html page will have reference to the js and css files provided, which will help display the results in a fancy way.
I'm using C# .
sample ---
<ABCResults>
<xyzResults xmlns = "http://xyz.com/schema/types">
<Result1>
<Result1_RULE>
<Result1Type>Fixed</Result 1Type>
</Result1_RULE>
</Result1>
</xyzResults>
</ABCResults>
so, I was thinking may be I can open the XML response file in a different tab in a browser, while that html page will have reference to the js and css files provided, which will help display the results in a fancy way.
I'm using C# .
sample ---
<ABCResults>
<xyzResults xmlns = "http://xyz.com/schema/types">
<Result1>
<Result1_RULE>
<Result1Type>Fixed</Result
</Result1_RULE>
</Result1>
</xyzResults>
</ABCResults>
can you post those js and css files here
probably we can use those like
probably we can use those like
<script>
var result = '<%=result%>';
// use libraries provided by client
</script>
ASKER
if i reference the Js and css, files the XML response displayed in the browser looks pretty and with those js files, I can click on a particular section of report and view details.
but problem, i'm having is , how to make the browser display that XML first. just plain XML text is also fine.
I can add the cs and js later.
but problem, i'm having is , how to make the browser display that XML first. just plain XML text is also fine.
I can add the cs and js later.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window
and see how does it look like on browser...
also, post a sample result...