SunQuest
           XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
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  
Old November 12th, 2003, 02:42 PM
zorrinn zorrinn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 25 zorrinn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 55 sec
Reputation Power: 0
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>

Reply With Quote
  #2  
Old November 13th, 2003, 06:23 PM
teedee teedee is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 42 teedee User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
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!

Reply With Quote
  #3  
Old November 14th, 2003, 08:36 AM
zorrinn zorrinn is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Nov 2003
Posts: 25 zorrinn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 15 m 55 sec
Reputation Power: 0
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > displays generated HTML code in Netscape


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 5 hosted by Hostway