Hello everyone,
Initially, our ASP page sends out an ASP call to the webserver to retrieve the data from a database.
Presently, the webserver's response is a chunk of XML data (in a data island) and a javascript which has reference to the XSL file for transforming that XML data into HTML. The following is an example :
-------------------------------------------------------------
<XML id="xmlData"> <?xml version="1.0"?><MDML><UI><ActionItem actionItemType="Button" actionItemLabel="Change" actionItemId="ActionItem_Change_Button" altValue="Change" helpFile="HelpFile_AppCmds" gifSrc="change.gif" ><FrameWrkAction appId="SystemCapacityApp" funcId="FI_Add_Chg" funcArgs="ViewId=0.100" actionId="Action_ID_Change_Load" actionArgs="(None)" target="noTarget" aspLink="" ></FrameWrkAction></ActionItem></UI><MetaData></MetaData><DBData></DBData></MDML> </XML>
******************* --- XSL file Reference --- *******************
<SCRIPT language="JavaScript">
<!--
var XSLFile= "xsl/uwi_RenderCmd.xsl";
//-->
</SCRIPT>
************************************************** ****************
The "content-type" of this response is "text/HTML" and is coded into the ASP page directly by the webserver.
Since this uses Data Islands (which makes it browser specific), I am trying to embed the XSL reference directly into the XML data and eliminate the DataIsland as shown below
<?xml version = "1.0"?>
<?xml-stylesheet type = "text/xsl" href = "xsl/uwi_RenderCmd.xsl"?>
.....
The good thing is that, as all browsers support XSLT, it works! But the problem is that it works ONLY if the XML data were stored in a file (with a ".XML" extension) on the server's directory and fed into the browser directly. As mentioned earlier, this data is present in an ASP file (which has a bunch of scripts which get loaded first before the browser processes this XML data). When it is processed, the browser is not recognizing it as XML data and is therefore not applying the Stylesheet on it.
Please be noted that when the ASP file is fed into Internet Explorer, the output is fine (i.e correct processing of XML and stylesheet) but it doesnot work on firefox or netscape.
Could anyone please describe a way I could tell the browser to process this chuck of XML data (of "text/HTML" content type) as "XML"?
You can either post the reply here, or could simple e-mail me at:
[email protected] (preferred)
I highly appreciate your patience in reading this lengthy e-mail.
Regards,
Asim