Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XML
|
XML General XML discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XML section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 12th, 2004, 10:55 PM
Registered User
 
Join Date: Oct 2004
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to Thebravehearth
Default Parsing an XSLT stylesheet failed .... :(

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'>
        &lt;z:row XValues = '<xsl:value-of select = '@XValues' />'
              YValues = '<xsl:value-of select = '@YValues' />'
        /&lt;
    </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~





Similar Threads
Thread Thread Starter Forum Replies Last Post
apply-template from included xslt stylesheet chobo XSLT 9 April 16th, 2008 05:25 PM
Error "Failed to compile stylesheet" amhicraig XSLT 1 December 7th, 2007 07:20 PM
Looking for developers for a XSLT stylesheet david_n XSLT 0 February 27th, 2007 10:03 AM
XSLT in IE: adding js object to a stylesheet Vx BOOK: Professional Ajax ISBN: 978-0-471-77778-6 2 August 22nd, 2006 11:00 AM
2 XML Docs > 1 XSLT Stylesheet kwilliams XSLT 3 September 12th, 2005 11:22 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.