|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Get inside! Sample the range of functionality easily built with JMSL Library for Time Series Data Analysis, Heat Maps, Portfolio Optimization, Monte Carlo Simulation, Stock Price Charting and more. Download Now! |
|
#1
|
|||
|
|||
|
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 |
|
#2
|
|||
|
|||
|
You're loading the XSL over http so you'll need to specify xslDoc.async=false
If that doesn't work then check that the XML and XSL are being loaded into the domdocuments ... if (xmlDoc.load("xml/hotel_list.xml")) { alert("XML Loaded ok"); } else { alert (xmlDoc.parseError.reason); } Does IE show a warning message about creating an ActiveX object when the page loads? Could be your security settings preventing you from running the script? |
|
#3
|
|||
|
|||
|
same xsl problem
hi
im facing a very similar problem the xmlns:xsl='www.w3.org/tr/xsl-wd' works fine on one computer but causes a crash on another. did you find anymore data on this? will be happy to get anything on it thanks xova |
|
#4
|
|||
|
|||
|
I think you should check your zone permissions in IE settings concerning ActiveX. I had the same problem while using other ActiveX objects in JavaScript and note, this will match for other your page visitors.
|
|
#5
|
||||
|
||||
|
I have a similar problem it get this back:
I am getting my information back but gibberish too why is this? It runs fine on my server just not when i upload it. 㰼ⴡ䕂䥇⁎整瑸朠湥牥瑡摥戠⁹敳癲牥䱐䅅䕓删䵅噏⁅ⴭਾ⼼扯敪瑣㰾氯祡牥㰾搯癩㰾猯慰㹮⼼瑳汹㹥⼼潮捳楲瑰㰾琯扡敬㰾猯牣灩㹴⼼灡汰瑥ਾ猼牣灩⁴慬杮慵敧∽慪慶捳楲瑰㸢瘊牡朠潯汧彥慬杮慵敧∽湥㬢㰊猯牣灩㹴㰊 捳楲瑰氠湡畧条㵥樢癡獡牣灩≴猠捲∽瑨灴⼺眯睷戮楲歮瑳牥挮浯戯楲歮樮≳㰾猯牣灩㹴㰊捳楲瑰氠湡畧条㵥樢癡獡牣灩≴眾潄⡌琢灯⤢㰻猯牣灩㹴㰊捳楲瑰氠湡畧条㵥樢癡獡牣灩≴眾汃⡳㬩⼼捳楲瑰ਾ猼牣灩⁴慬杮慵敧∽慪慶 捳楲瑰㸢䑷䱯∨瑢≭㬩⼼捳楲瑰ਾ猼牣灩⁴慬杮慵敧∽慊慶捓楲瑰㸢桳睯⡁摡摉㬩⼼捳楲瑰ਾℼⴭ䔠䑎琠硥⁴敧敮慲整祢猠牥敶倠䕌十⁅䕒位䕖ⴠ㸭pse: collapse" bordercolor="#999999" width="160" bgcolor="#5C7287">MavCom InformationE-mail =Typhon= MavCom 3 MavCom 13 MavCom 14 䐀噉ാ㰊戯摯㹹⼼瑨汭ാ㰊ⴡ䕂䥇⁎整瑸朠湥牥瑡摥戠⁹敳癲牥䱐䅅䕓删䵅噏⁅ⴭਾ⼼扯敪瑣㰾氯祡牥㰾搯癩㰾猯慰㹮⼼瑳汹㹥⼼潮捳楲瑰㰾琯扡敬㰾猯牣灩㹴⼼灡汰瑥ਾ猼牣灩⁴慬杮慵敧∽慪慶捳楲瑰㸢瘊牡朠潯汧彥 慬杮慵敧∽湥㬢㰊猯牣灩㹴㰊捳楲瑰氠湡畧条㵥樢癡獡牣灩≴猠捲∽瑨灴⼺眯睷戮楲歮瑳牥挮浯戯楲歮樮≳㰾猯牣灩㹴㰊捳楲瑰氠湡畧条㵥樢癡獡牣灩≴眾潄⡌琢灯⤢㰻猯牣灩㹴㰊捳楲瑰氠湡畧条㵥樢癡獡牣灩≴眾汃⡳㬩⼼捳楲 瑰ਾ猼牣灩⁴慬杮慵敧∽慪慶捳楲瑰㸢䑷䱯∨瑢≭㬩⼼捳楲瑰ਾ猼牣灩⁴慬杮慵敧∽慊慶捓楲瑰㸢桳睯⡁摡摉㬩⼼捳楲瑰ਾℼⴭ䔠䑎琠硥⁴敧敮慲整 |
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XSL Transformation works fine locally but not when the files are uploaded |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|