Hi All ... i have question anymore ...:)
i want view XML data with XSL file.
this my asp file to get XML data from SQL server(detail.asp)
<%@ Language=VBScript %>
<%
dim sSelect
dim sRep
sPeriode = Request.Form ("selectdate")
sRep = Request.Form("rep")
Response.ContentType = "text/xml"
Dim objConn
Dim objComm
dim sPeriode
Set objConn = Server.CreateObject("ADODB.Connection")
Set objComm = Server.CreateObject("ADODB.Command")
objConn.Open "PROVIDER=SQLOLEDB; SERVER=.; UID=sa;PWD=;DATABASE=DataKU;"
Set objComm.ActiveConnection = objConn
Response.Write "<?xml version='1.0'?> <?xml-stylesheet type='text/xsl' href='schema.xsl'?> "
Response.Write "<root>"
objComm.CommandText = "SELECT kd_field, isi_field FROM field_lap where periode= '" & sPeriode & "' and kd_lap= '"& srep &"' for xml auto"
objComm.Properties("Output Stream") = Response
objComm.Execute , , 1024 'adExecuteStream = 1024
Response.Write "</root>"
Set objComm = Nothing
objConn.Close
Set objConn = Nothing
%>
and this is my Schema.xsl
<xsl:stylesheet xmlns:xsl="http://www.w2.org/1999/XSL/Transform" version="1.0">
<xsl:template match ='*'>
<xsl:apply-templates/>
</xsl:template>
<xsl:template match ='field_lap'>
<z:row XValues = '<xsl:value-of select = '@XValues' />'
YValues = '<xsl:value-of select = '@YValues' />'
/<
</xsl:template>
<xsl:template match = '/'>
<xml xmlns:s='uuid:BDC6E3F0-6DA3-11d1-A2A3-00AA00C14882'
xmlns:dt='uuid:C2F41010-65B3-11d1-A29F-00AA00C14882'
xmlns:rs='urn:schemas-microsoft-com:rowset'
xmlns:z='#RowsetSchema'>
<s:Schema id='RowsetSchema'>
<s:ElementType name ='row' content='eltOnly'>
<s:attribute type='XValues'/>
<s:attribute type='YValues'/>
<s:extends type='rs:rowbase'/>
</s:ElementType>
<s:AttributeType name='XValues' rs:number='1'>
<s:datatype dt:type='string' dt:maxlength='15'/>
</s:AttributeType>
<s:AttributeType name='YValues' rs:number='2'>
<s:datatype dt:type='fixed.14.4'/>
</s:AttributeType>
</s:schema>
<rs:data>
<xsl:apply-templates select = 'root'/>
</rs:data>
</xml>
</xsl:template>
</xsl:stylesheet>
with that code i get response from IE like this
The XML page cannot be displayed
Cannot view XML input using XSL style sheet. Please correct the error and then click the Refresh button, or try again later.
--------------------------------------------------------------------------------
The stylesheet does not contain a document element. The stylesheet may be empty, or it may not be a well-formed XML documen...
and the result from mozilla is
Error loading stylesheet: Parsing an XSLT stylesheet failed.
so ... i need ur advice and litle code to solve this matter.
thanks alot
http://UrGoBlog.Blogspot.com/
~TAT TWAM ASI~