Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP XML
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Classic ASP XML Using ASP 3 and XML. See also the XML category for more XML discussions not relating to ASP. NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP XML section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 31st, 2006, 03:21 PM
Registered User
Points: 31, Level: 1
Points: 31, Level: 1 Points: 31, Level: 1 Points: 31, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2006
Location: Kanata, Ontario, Canada.
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Transforming XML data in an ASP file using XSLT

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:
cnrme@hotmail.com (preferred)

I highly appreciate your patience in reading this lengthy e-mail.

Regards,
Asim
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Show CURRENT DATE when transforming XML using XSLT richieWolf XSLT 0 October 20th, 2007 07:47 PM
Exception when transforming using XSLT ksskumar XSLT 5 October 10th, 2006 06:20 AM
Transforming data in required XML Format pvasudevan XSLT 6 September 6th, 2006 02:34 AM
problem transforming XML using xslt micky3248 XSLT 7 August 18th, 2006 03:52 AM
Please help, xml transforming using xslt !!! daula7 XSLT 0 May 11th, 2006 01:29 PM



All times are GMT -4. The time now is 02:07 PM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.