Article View: be.comp.programming
Article #10083asp.net // xml // stylesheet
From: Alex
Date: Sun, 31 Mar 2002 14:08
Date: Sun, 31 Mar 2002 14:08
56 lines
2218 bytes
2218 bytes
Kan er mij iemand helpen.
Heb een standaard xml fileke geschreven
<?xml version="1.0" encoding="utf-8" ?>
<?xml:stylesheet href="Ssxml.css" type="text/css" ?>
....
Smijt daarna dit xml file in een asp.net file.
<%@ Page Language="C#" Debug="true" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Xml" %>
<HTML>
<script runat="server">
void Page_Load()
{
DataSet vDataSet= new DataSet();
vDataSet.ReadXml(@"C:\Inetpub\wwwroot\WebProject2\XMLFile1.xml");
txtDataGrid.DataSource=vDataSet;
txtDataGrid.DataBind();
}
</script>
<body>
Gegevens uit de Xml File !<hr>
<asp:Datagrid id="txtDataGrid" runat="server" width="100%" />
</body>
</HTML>
Alles werkt tot ik een stylesheet in men xml file binnenbreng, als ik dan
compileer dan krijg ik deze xmlException fout
Exception Details: System.Xml.XmlException: 'xml:stylesheet' is an invalid
name for a processing instruction. Line 2, position 3.
Source Error:
Line 10:
Line 11: DataSet vDataSet= new DataSet();
Line 12: vDataSet.ReadXml(@"C:\Inetpub\wwwroot\WebProject2\XMLFile1.xml");
Line 13:
Line 14: txtDataGrid.DataSource=vDataSet;
Technical Details
Message-ID:
<qLEp8.41446$DE4.5418@afrodite.telenet-ops.be>Path:
arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!sunqbc.risq.qc.ca!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mailShow Full Headers
Complete Article Headers
X-Google-Language: DUTCH,ASCII-7-bit X-Google-Thread: fcea4,2d8020dba169d372,start X-Google-Attributes: gidfcea4,public X-Google-ArrivalTime: 2002-03-31 06:08:23 PST Path: arc1-ca.pugleaf.net!archiver1.google.com!news1.google.com!sn-xit-02!sn-xit-03!supernews.com!newsswitch.lcs.mit.edu!sunqbc.risq.qc.ca!newsfeeds.belnet.be!news.belnet.be!ossa.telenet-ops.be!afrodite.telenet-ops.be.POSTED!not-for-mail From: "Alex" <alex.dierycx@pandora.be> Newsgroups: be.comp.programming Subject: asp.net // xml // stylesheet Lines: 58 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 5.00.2615.200 X-MimeOLE: Produced By Microsoft MimeOLE V5.00.2615.200 Message-ID: <qLEp8.41446$DE4.5418@afrodite.telenet-ops.be> Date: Sun, 31 Mar 2002 14:08:22 GMT NNTP-Posting-Host: 213.119.39.93 X-Complaints-To: abuse@telenet.be X-Trace: afrodite.telenet-ops.be 1017583702 213.119.39.93 (Sun, 31 Mar 2002 16:08:22 MET DST) NNTP-Posting-Date: Sun, 31 Mar 2002 16:08:22 MET DST Organization: Telenet Internet