Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

create html from web service that returns xml

Posted on 2009-04-15
3
Medium Priority
?
221 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
3 proven steps to speed up Magento powered sites. The article focus is on optimizing time to first byte (TTFB), full page caching and configuring server for optimal performance.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…
Suggested Courses

618 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