Solved

create html from web service that returns xml

Posted on 2009-04-15
3
214 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

Title # Comments Views Activity
selecting a category and selecting subcategories 7 51
razorCMS: Change Menu Font 4 60
Python - desktop use 1 32
XSLT -  replace invalid xml characters 15 35
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
Many times as a report developer I've been asked to display normalized data such as three rows with values Jack, Joe, and Bob as a single comma-separated string such as 'Jack, Joe, Bob', and vice versa.  Here's how to do it. 
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

809 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