|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
SlickEdit: Code in over 40 languages across 7 platforms. SlickEdit’s unmatched power, speed, and flexibility allows even the most accomplished developers to write better code faster. Download a free trial today! |
|
#1
|
|||
|
|||
|
displays generated HTML code in Netscape
Sorry for the long code. When it is display in IE it works fine. But in netscape all I see is the generated HTML code itself. Any idea??
Code:
<?xml version="1.0" encoding="UTF-8" ?>
<!--
Document : pyxis_drug_list.xsl
Created on : November 11, 2003
Author : lkumar
Comment
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<!-- template rule matching source root element -->
<xsl:template match="/">
<html>
<head>
<title>Pyxis Floor Stock Application</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<META HTTP-EQUIV="Expires" CONTENT="Mon, 06 Jan 1990 00:00:01 GMT" />
<META HTTP-EQUIV="Pragma" CONTENT="no-cache" />
<META HTTP-EQUIV="Cache-Control" CONTENT="no-cache" />
<script src="../javascript/pyxis.js" LANGUAGE="JavaScript" type="text/javascript"></script>
<link href="../css/ipv.css" rel="stylesheet" type="text/css"/>
</head>
<body background="../images/page_left.gif" text="#000000" leftmargin="15" topmargin="0" marginwidth="15" marginheight="0">
<table width="100%" cellspacing="0" border="1" cellpadding="2">
<tr>
<td width="70%" class="head">Drug Name</td>
<td width="30%" class="head">MedStation</td>
</tr>
<xsl:for-each select="druglist/list">
<xsl:variable name="OUTROWID"><xsl:value-of select="position()"/></xsl:variable>
<xsl:variable name="toprowval">
<xsl:choose>
<xsl:when test='position() mod 2 = 0'>altrow</xsl:when>
<xsl:otherwise>row</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<tr>
<td width="70%" class="{$toprowval}"><xsl:value-of select="drugname"/></td>
<td width="30%" class="{$toprowval}"><xsl:value-of select="medstation"/></td>
</tr>
</xsl:for-each>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
|
|
#2
|
|||
|
|||
|
I'm really confused, I tried your XSL in Netscape 7.1 and it worked just fine, I get the table and the transform output is displayed correctly.
If your transform works on your local PC but not over HTTP then it's possible that the web server isn't sending the correct MIME type for XML files? IE isn't too bothered about checking MIME type and tends to make its own mind up about how to handle the XML but if Netscape gets the Apache default value of "text/plain" then maybe it's displaying it as plain text? Just a guess really, I'm stumped here! |
|
#3
|
|||
|
|||
|
I develop it real-time on the Unix server that runs JRun. So it either works properly or does not.
The funny part is that I have other pages using similair XML/XSL/CSS and they seem to be fine. This particular one is created while I do a form sumbit and generate a XMl file using a servlet. My HTML Code:
<form name="searchForm" method="post" action="/ipv/servlet/PFSADrugList" target="bottomFrame" onSubmit="return validateEntry();"> <div align="left"><a href="javascript:validateAndSend();" onMouseMove="window.status='Search Drugs in Medstation';return true" onMouseOver="window.status='Search Drugs in Medstation';return true" onMouseOut="window.status='';return true"><img src="images/search_btn.gif" border="0"></a> My JavaScript Code:
function validateAndSend()
{
if(trimNew(document.searchForm.srch_medstation.value)=="" && trimNew(document.searchForm.srch_drugname.value)==""){
alert("Atleast one search parameter is required.");}
else{
document.searchForm.submit();}
}
function trimNew(pstrString)
{
var intLoop=0;
for(intLoop=0; intLoop<pstrString.length; )
{
if(pstrString.charAt(intLoop)==" ")
pstrString=pstrString.substring(intLoop+1, pstrString.length);
else
break;
}
for(intLoop=pstrString.length-1; intLoop>=0; intLoop=pstrString.length-1)
{
if(pstrString.charAt(intLoop)==" ")
pstrString=pstrString.substring(0,intLoop);
else
break;
}
return pstrString;
}
The XML generated would be in the form of Code:
<druglist>
<list>
<drugname>......</drugname>
<medstation>.....</medstation>
</list>
<list>
.....
</druglist>
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > displays generated HTML code in Netscape |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|