Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Shtm file not showing xml

Status
Not open for further replies.

URLJones

Programmer
Jun 14, 2004
42
CA
Hi. I have an shtml file with some server-side includes and I would like to display some xml content on it. I have an html version of the file and the xml shows up fine, but there are no server-side-includes visible on the webpage. When using a .shtm extension, the includes show up, but the xmal doesn't. Is it possible to show xml in an shtml document? Any help would be much appreciated.

Thanks,

URL
 
Can you provide some examples of code ?

.shtm,.shtml - the "s" tells the server to process this file before responding without this extension or one of the other standards asp,aspx,jsp,php... your server side includes will not display

i assume that by displaying xml in a web page you either want to query for a dynamic xml file that changes constantly or is generated on demand and load it into your page or you just want to display static xml data. for either there are alot of options you can take the easiest may be a simple transform ro even an iframe or you could use a javascript method for both.

since you are utilizing SSI's i would suggest processing the xml on the server side as this doesn't leave users who dont support javascript in the dark

what server side language are you using?

MCP, .Net Solutions Development <%_%>
 
Hi werD40.

Thanks alot for the reply. Unfortunately, I can't show too much of the code since it resides on an internal site. I have various Javascript methods which use the XMLDom to load some XML files and place them in the desired location on the webpage. So, your assumption is correct. I have a set of of tabs at the top of the page and depending on what tab you click on, the main content-area changes it's inner HTML to whatever is in the associated xml file.

The real issue however, as I mentioned before, is that the .shtm displays the included Server-Side includes, but no xml content. When I change the file extension to ".htm", the opposite occurs - no ssi's, but the xml content is visible. The SSI's are a requirement on this site since it follows the corporate design.

Also, I can't change the SSI's because they are used by other standard (non-xml) shtm files, and, in order to maintain the integrity of the information provided in the SSI, the option of creating a new file is not something I'd like to do.

You mentioned there were other methods of including xml data in an html document?

oh, and I'm not really using any server-side language at the moment. I have used a bit of Ajax with ASP for some form validation and whatnot. But, on the page in question I haven't used anything in particular.

Thanks,

URL
 
What HTTP server are you using? (I know you say ASP at one point but don't know if it is related to this problem.)

Tom Morrison
 
Thanks for the quick replies. But, I've solved the problem.

The problem turned out to be a duplicate names used for functions and id's in the includes files. So, what I had on the main page was a form with an ID of "searchForm". Inside this form I had a text-field called "searchField". Lastly, I had the form call the function "preSubmit" when the user clicked the submit button.

In the left-menu include file, I also declared a site-wide search form with the same IDs. So, as you can imagine there was some confusion when compiling the shtm on the server.

Also, one thing to point out: this wasn't noticable in the HTML since it ignores the "include" declaration and treats it as a comment. So, since the include files were not included in the html, there was no duplicate ID's being instantiated; only the the IDs on the main form were considered.

- URL
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top