Hi All,
I am trying to display a table report using XML and XSLT, but could not get it to work. Here are my files:
XML File:
< xml-stylesheet type="text/xslt" href="..\testlog.xslt" >
<LogMessages> <LogMessage EntryNo="000000000001" EventNo="30000" User="System" Interface="" ProcessId="608" BytesTransferred="0" BytesReadWrite="0" Time="20061026202051825"> <![CDATA[
Program starts.... ]]> </LogMessage> <LogMessage EntryNo="000000000003" EventNo="30001" User="System" Interface="" ProcessId="608" BytesTransferred="0" BytesReadWrite="0" Time="20061026202051825"> <![CDATA[ Configuration loaded: * Keypair: MD5: ec:27:2a:30:e2:5d:4b:88:b2:0e:71:2e:e3:fd:33:11 Babble: xebaf-lepuf-lapab-hefuk-vomif-dymem-ciniz-putys-zytut-secul-duxix* ]]> </LogMessage> <LogMessage EntryNo="000000000004" EventNo="30240" User="System" Interface="" ProcessId="608" BytesTransferred="0" BytesReadWrite="0" Time="20061026202051845"> <![CDATA[ Listening on interface 0.0.0.0:22 ]]> </LogMessage> <LogMessage EntryNo="000000000005" EventNo="30005" User="System" Interface="" ProcessId="608" BytesTransferred="0" BytesReadWrite="0" Time="20061026202051845"> <![CDATA[ Service started, executable file name:myTest.exe ]]> </LogMessage>
</LogMessages>
And here is my XSLT file (Table block):
< TABLE width="430">
<TR>
<TH>Event No.</TH>
<TH>Process Id</TH>
<TH>User Name</TH>
<TH>Ip Address</TH>
<TH>Log Time</TH>
</TR>
<xslt:for-each select="LogMessages/LogMessage">
<TR>
<TD Width="200"><xslt:value-of select
/></TD>
<TD Width="200"><xslt:value-of select
/></TD>
<TD Width="200"><xslt:value-of select
/></TD>
<TD Width="200"><xslt:value-of select
/></TD>
<TD Width="200"><xslt:value-of select
/></TD>
</TR>
</xslt:for-each>
</TABLE>
When I double click on the XML file, instead of displaying the table, it only displays the XML file. Yes, it returns me an error if I delete the xslt file, which means that it does look for the ref="" on the XML file. However, some how, it does not translate properly.
Can anyone tell me what is wrong with my code in the xslt table definition. Also, how to I display the data in the CDATA section on a last column in the table
Thanks in advance.
.NET Development23
|