•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the XML, XSLT and XPATH section within the Software Development category of DaniWeb, a massive community of 373,375 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,787 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our XML, XSLT and XPATH advertiser:
Views: 1965 | Replies: 1 | Solved
![]() |
•
•
Join Date: Sep 2007
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
Hello everybody, this is a sad story really, 3 days ago my code worked fine now it don't. I get this error "XML Parsing Error: junk after document element
Location: http://localhost:1218/projektCsharp/Default.aspx
Line Number 11, Column 1:"
If i try to remove or mark out
"<?xml version="1.0" encoding="utf-8" ?>
<guestbook xmlns="http://me.com/guest.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://me.com/ guest.xsd"> from the XML file then i get a HTTP 403 Forbidden error.
What can be wrong? thx in advance. //DK
PS it supposed to be a simple guestbook.
</guestbook>"
XML FILE
XSD FILE
DEFAULT PAGE just the page load
Location: http://localhost:1218/projektCsharp/Default.aspx
Line Number 11, Column 1:"
If i try to remove or mark out
"<?xml version="1.0" encoding="utf-8" ?>
<guestbook xmlns="http://me.com/guest.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://me.com/ guest.xsd"> from the XML file then i get a HTTP 403 Forbidden error.
What can be wrong? thx in advance. //DK
PS it supposed to be a simple guestbook.
</guestbook>"
XML FILE
<?xml version="1.0" encoding="utf-8" ?> <guestbook xmlns="http://me.com/guest.xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://me.com/ guest.xsd"> </guestbook>
<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema id="guest" targetNamespace="http://me.com/guest.xsd"
elementFormDefault="qualified"
xmlns="http://www.w3.org/2001/XMLSchema"
xmlns:mstns="http://me.com/guest.xsd"
xmlns:xsd="http://www.w3.org/2001/guest.xsd">
<xsd:element name="Guests" >
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="Guest">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="Name" type="xsd:string" minOccurs="0" />
<xsd:element name="Country" type="xsd:string" minOccurs="0" />
<xsd:element name="Email" type="xsd:string" minOccurs="0" />
<xsd:element name="Comments" type="xsd:string" minOccurs="0" />
<xsd:element name="DateTime" type="xsd:string" minOccurs="0" />
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
DEFAULT PAGE just the page load
protected void Page_Load(object sender, EventArgs e)
{
string email="member69@hotmail.com";
string name="joe doe";
string country="helvetia";
string comments="funkis??";
string datetime="2minutestomidnight";
XmlWriterSettings settings = new XmlWriterSettings();
settings.Indent = true;
settings.NewLineOnAttributes = true;
Response.ContentType = "text/xml";
XmlSerializerFactory factory = new XmlSerializerFactory();
using (XmlWriter writer = XmlWriter.Create(Response.OutputStream, settings))
{
writer.WriteStartDocument();
writer.WriteStartElement("Guests");
writer.WriteStartElement("Guest");
writer.WriteStartAttribute("Name");
writer.WriteValue(name);
writer.WriteEndAttribute();
writer.WriteStartAttribute("Country");
writer.WriteValue(country);
writer.WriteEndAttribute();
writer.WriteStartAttribute("Email");
writer.WriteValue(email);
writer.WriteEndAttribute();
writer.WriteStartAttribute("Comments");
writer.WriteValue(comments);
writer.WriteEndAttribute();
writer.WriteStartAttribute("DateTime");
writer.WriteValue(datetime);
writer.WriteEndAttribute();
writer.WriteEndElement();
writer.WriteEndElement();
writer.WriteEndDocument();
}
} Last edited by Dha_King : Jan 1st, 2008 at 1:48 pm.
•
•
Join Date: Sep 2007
Posts: 13
Reputation:
Rep Power: 1
Solved Threads: 0
I forgott
DEFAULT.ASPX
It seems to work if i comment out the default.aspx, i have no idea what's wrong here. Please help me. =)
DEFAULT.ASPX
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</form>
</body>
</html>It seems to work if i comment out the default.aspx, i have no idea what's wrong here. Please help me. =)
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb XML, XSLT and XPATH Marketplace
•
•
•
•
algos api asp bebo blogger blogging code development dom drama feed fortitude gdata google hope html javascript smooth scrolling scroll smoothly window document position katemodern linspire linux lonelygirl15 microsoft news openoffice programming reader rss soap standards struggle trial-and-error tv victory video w3c weather web xml xoap youtube
- Previous Thread: some noobish questions about xml, xsl
- Next Thread: New to XML


Linear Mode