Solved

create html from web service that returns xml

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

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say 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

Suggested Solutions

The Client Need Led Us to RSS I recently had an investment company ask me how they might notify their constituents about their newsworthy publications.  Probably you would think "Facebook" or "Twitter" but this is an interesting client.  Their cons…
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. 
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

679 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