Hiya peeps,
Okies, I have been trying to work this out for a while now to no avail... I am a beginner to this whole coding thing but have made great strides in my project. Basically what I am trying to do is to convert an .xml using a .xsl to and using a java script to output it into a readable format within excel. I have been able to successfully use a javascript to combine my .xml and .xsl but cannot figure out how to have it output to excel. Please help if possible!
And if thats easy enough what about fomatting my time and date in (DD/MM/YY HH:mm:ss)
Thanks in advance!
Here are the files I have been working with:
JAVASCRIPT
<%
response.setContentType("application/vnd.ms-excel");
%>
<html>
<body>
<script type="text/javascript">
//Load XML
var xml=new ActiveXObject("Microsoft.XMLDOM")
xml.async=false
xml.load("test.xml")
//Load the XSL
var xsl=new ActiveXObject("Microsoft.XMLDOM")
xsl.async=false
xsl.load("test.xsl")
//Transform
document.write(xml.transformNode(xsl))
</script>
</body>
</html>
XSL FILE
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<!-- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> -->
<html>
<head>
<link rel="stylesheet" type="text/css" href="C:\test.css" />
</head>
<body>
<div id="container">
<div class="tableContainer">
<table class="report">
<tbody>
<xsl:for-each select="fasting/pickups/pickup">
<tr>
<td class="Passing"><xsl:text/></td>
<td class="Type"><xsl:text/>Pickup</td>
<td class="Object"><xsl:value-of select="@id"/></td>
<td class="Begining"><xsl:value-of select="@begin"/></td>
<td class="Halting"><xsl:value-of select="@halt"/></td>
<td class="Length"><xsl:text/></td>
<td class="Status"><xsl:text/>X</td>
<td class="Begining"><xsl:text/></td>
<td class="Halting"><xsl:text/></td>
<td class="Length"><xsl:text/></td>
<td class="FRP"><xsl:value-of select="@frp"/></td>
<td class="Dome"><xsl:value-of select="load/@dome"/></td>
<td class="Timely"><xsl:value-of select="load/@timely"/></td>
<td class="Pri"><xsl:text/></td>
<td class="Notes"><xsl:text/></td>
</tr>
</xsl:for-each>
<xsl:for-each select="fasting/putdown/airline">
<tr>
<td class="Passing"><xsl:text/></td>
<td class="Type"><xsl:text>Putdown </xsl:text>
<xsl:value-of select="@id"/></td>
<td class="Object"><xsl:value-of select="file/@id"/></td>
<td class="Begining"><xsl:value-of select="@begin"/></td>
<td class="Halting"><xsl:value-of select="@halt"/></td>
<td class="Length"><xsl:text/></td>
<td class="Status"><xsl:text/>X</td>
<td class="Begining"><xsl:text/></td>
<td class="Halting"><xsl:text/></td>
<td class="Length"><xsl:text/></td>
<td class="PRF"><xsl:value-of select="@prf"/></td>
<td class="Dome"><xsl:value-of select="load/@dome"/></td>
<td class="Timely"><xsl:value-of select="load/@timely"/></td>
<td class="Prioroity"><xsl:text/></td>
<td class="Notes"><xsl:text/></td>
</tr>
</xsl:for-each>
</tbody>
</table>
</div>
</div>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
XML FILE
<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="C:\Test.xsl" ?>
<fasting begin="09 27 2007 15:46:59" halt="09 28 2007 15:37:43">
<pickups>
<pickup id="data4321093" begin="09 27 2007 10:46:59" halt="09 27 2007 10:47:05" frp="false">
<load id="X" dome="005" timely="BB"></load>
</pickup>
<pickup id="data123411" begin="09 27 2007 11:43:16" halt="09 27 2007 11:55:49" frp="false">
<load id="Y" dome="003" timely="BB"></load>
</pickup>
<pickup id="data432113" begin="09 27 2007 12:26:34" halt="09 27 2007 12:26:40" frp="false">
<load id="X" dome="001" timely="BB"></load>
</pickup>
<pickup id="data1234111" begin="09 27 2007 13:35:30" halt="09 27 2007 13:44:54" frp="false">
<load id="Y" dome="002" timely="BB"></load>
</pickup>
<pickup id="data4321121" begin="09 27 2007 14:03:54" halt="09 27 2007 14:11:19" frp="false">
<load id="X" dome="102" timely="BB"></load>
</pickup>
<pickup id="data1234131" begin="09 27 2007 20:43:41" halt="09 27 2007 21:01:18" frp="false">
<load id="Y" dome="001" timely="BB"></load>
</pickup>
<pickup id="data1234141" begin="09 27 2007 22:37:54" halt="09 27 2007 22:41:10" frp="false">
<load id="Y" dome="004" timely="BB"></load>
</pickup>
<pickup id="data1234011" begin="09 28 2007 01:59:33" halt="09 28 2007 02:09:02" frp="false">
<load id="Y" dome="002" timely="BB"></load>
</pickup>
<pickup id="data4321013" begin="09 28 2007 03:45:57" halt="09 28 2007 03:46:03" frp="false">
<load id="X" dome="004" timely="BB"></load>
</pickup>
<pickup id="data4321021" begin="09 28 2007 04:40:54" halt="09 28 2007 04:48:49" frp="false">
<load id="X" dome="102" timely="BB"></load>
</pickup>
<pickup id="data4321023" begin="09 28 2007 05:31:04" halt="09 28 2007 05:31:10" frp="false">
<load id="X" dome="001" timely="BB"></load>
</pickup>
<pickup id="data1234081" begin="09 28 2007 14:15:45" halt="09 28 2007 14:19:01" frp="false">
<load id="Y" dome="004" timely="BB"></load>
</pickup>
<pickup id="data4321083" begin="09 28 2007 14:57:57" halt="09 28 2007 14:58:03" frp="false">
<load id="X" dome="001" timely="BB"></load>
</pickup>
<pickup id="data4321091" begin="09 28 2007 15:06:32" halt="09 28 2007 15:06:38" frp="false">
<load id="X" dome="101" timely="BB"></load>
</pickup>
<pickup id="data4321093" begin="09 28 2007 15:37:37" halt="09 28 2007 15:37:43" frp="false">
<load id="X" dome="001" timely="BB"></load>
</pickup>
</pickups>
<putdown>
<airline id="R" begin="09 27 2007 16:11:37" halt="09 27 2007 16:26:37">
<file id="data4321093" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 00:42:55" halt="09 28 2007 00:57:55"></airline>
<airline id="R" begin="09 28 2007 01:26:30" halt="09 28 2007 01:38:34">
<file id="data1234011" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 02:25:10" halt="09 28 2007 02:40:10">
<file id="data4321013" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 03:08:45" halt="09 28 2007 03:19:53">
<file id="data4321021"></file>
</airline>
<airline id="R" begin="09 28 2007 04:07:26" halt="09 28 2007 04:22:26">
<file id="data4321021" last="true"></file>
<file id="data4321023" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 04:51:01" halt="09 28 2007 05:02:26">
<file id="data4321032" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 05:49:42" halt="09 28 2007 06:04:42">
<file id="data4321033" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 06:33:16" halt="09 28 2007 06:48:00">
<file id="data1234041" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 07:31:57" halt="09 28 2007 07:46:57">
<file id="data4321042" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 08:16:00" halt="09 28 2007 08:30:42"></airline>
<airline id="R" begin="09 28 2007 09:57:48" halt="09 28 2007 10:10:09">
<file id="data4321052" last="true"></file>
<file id="A807" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 10:56:28" halt="09 28 2007 11:11:28">
<file id="data4321061" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 11:40:03" halt="09 28 2007 11:51:18"></airline>
<airline id="R" begin="09 28 2007 12:38:44" halt="09 28 2007 12:53:44">
<file id="data1234071" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 14:20:59" halt="09 28 2007 14:35:59">
<file id="data1234081" last="true"></file>
<file id="data4321083" last="true"></file>
</airline>
<airline id="R" begin="09 28 2007 15:04:34" halt="09 28 2007 15:19:25"></airline>
</putdown>
</fasting>