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:
  #1  
Old October 28th, 2003, 05:25 PM
Ricardo Ricardo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 Ricardo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy XSL Transformation works fine locally but not when the files are uploaded

Hi everyone!

Please help me with this problem.

I am using the follwing javascript code to do an XSL-XML transformation. It's working fine on my computer when I double-click the html page but once the files are uploaded the transformation doesn't work there.

Even more if I test the pages through the IIS as a virtual directory (but still in my computer) it doesn't work neither.

I am figuring out the problem is because the "xml/hotel_list.xml" and "xml/hotel_list.xsl" relative paths are not working in the xslDoc.load statements but I have tested several alternatives using "http://..." paths and I can't make this work.

I would appreciate any help you can give me I am feeling lost and frustated.

This is the javascript function:
function filter_destino(filtro_destino,column){
try{
var xslDoc = new ActiveXObject("MSXML2.FreeThreadedDOMDocument");
xslDoc.load("xml/hotel_list.xsl");

var xslt = new ActiveXObject("MSXML2.XSLTemplate");
xslt.stylesheet = xslDoc;

var xslProc = xslt.createProcessor();
xslProc.addParameter("column", column);
xslProc.addParameter("filtro_destino", filtro_destino);

var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");
xmlDoc.async = false;
xmlDoc.resolveExternals = false;
xmlDoc.load("xml/hotel_list.xml");

xslProc.input = xmlDoc;
xslProc.transform();

document.all.item("xslContainer").innerHTML=xslProc.output;


}catch(exception){
}
}

The function is called from an html on the Body onLoad event:

<BODY onLoad="filter_destino('Cancun','HOTEL_NAME');">

The javascript function is in a external file referenced at the head section in this html page.
<script language="javascript" src="javascripts/filter.js"></script>

The first lines of the xsl files are:
<?xml version='1.0' encoding='iso-8859-1' ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml">
<xsl:output method="html" indent="yes" encoding="iso-8859-1" media-type="text/html"/>
<xsl:param name="column" select="'HOTEL_NAME'" />
<xsl:param name="name" select="''" />
<xsl:param name="filtro_destino" select="''" />
<xsl:variable name="destino" select="HOTEL[HOTEL_DESTINATION=$filtro_destino]" />

Thanks in advance.

Ricardo

Reply With Quote
  #2  
Old October 30th, 2003, 09:09 AM
imbrokn imbrokn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2001
Location: NJ
Posts: 428 imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level)imbrokn User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 11 h 34 m 8 sec
Reputation Power: 10
Send a message via AIM to imbrokn
Try loading your doc relative to the website root. For example if your file is located at : http://www.yoursite.com/xml/hotel_list.xml, then load your file as :

xml.load(server.mappath("/xml/hotel_list.xml") // Sorry i don't know the JS equivalent for 'server.mappath

Reply With Quote
  #3  
Old October 30th, 2003, 03:23 PM
Ricardo Ricardo is offline
Junior Member
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Oct 2003
Posts: 3 Ricardo User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Thanks imbrokn

Thanks for your reply, I find out the problem this morning, it was the async property of the xsl file. I was setting to false this property before the load of the xml file but I wasn't doing it for the xsl file.

It was a good situatuion to learn a little more about xml.

Thank you very much for your reply.

Ricardo.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL Transformation works fine locally but not when the files are uploaded


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 6 hosted by Hostway