Solved

create html from web service that returns xml

Posted on 2009-04-15
3
213 Views
Last Modified: 2012-05-06
I am trying to create an html select tag based on the results I get back from a web service.  The web services creates the html.  I get the return string and want to place it in my web page.  I am getting a string back but it is not showing up as html but just as a string.  This is the results from the web service:

  <?xml version="1.0" encoding="utf-8" ?>
  <string xmlns="http://audintranet/SIREJVSvc"><SELECT id='OpenAcctgPeriodsSelect' onChange='GetJVNo();'><OPTION value='4,2009'>April 2009</OPTION></SELECT></string>

What shows up in the web page is the select statement as a string.  The way I place it in the page is by the following:

document.getelementbyid("myDiv").innerHTML = httpResponse.responseText

How in the world do I get my string to show up as html?
0
Comment
Question by:audExpert
  • 2
3 Comments
 
LVL 12

Expert Comment

by:Gibu George
ID: 24150314
you need to set the respponse content type to text/html
0
 

Accepted Solution

by:
audExpert earned 0 total points
ID: 24152302
Maybe that works.  I ended up doing this:

 var xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
        xmlDoc.async="false";
        xmlDoc.loadXML(xmlHttp.responseText);
        document.getElementById("JVNo").innerHTML=xmlDoc.getElementsByTagName("string")[0].childNodes[0].nodeValue;
0
 

Author Comment

by:audExpert
ID: 24377817
Found own solution. Please see mylast comment.
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

DotNetNuke (DNN) (http://www.dotnetnuke.com) is a leading open source web content management system (CMS) and application development framework for Microsoft .NET. Localization is an essential part of building websites, especially in countries that …
Since I am currently running into this issue right now as I type this, I though I would share my experiences with moving a ModX Revolution site from one server to another.  It is not an easy task, but can be accomplished rather easily. The first …
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

861 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

26 Experts available now in Live!

Get 1:1 Help Now