Re: Maddening working with .NET/.XSDs
- From: Martin Honnen <mahotrash@xxxxxxxx>
- Date: Fri, 12 Jan 2007 15:14:49 +0100
cada0310 wrote:
So I create the above in a file, create a matching XSD in Visual Studio, and use a FileStream and XmlSerializer to try and read the thing in. I always get an error at (2,2) unless I make the 2nd line look like this:
<Chris xmlns="http://tempuri.org/Chris.xsd">
I'm presuming that it doesn't want to parse it because it's trying to match this line in my auto-generated .CS file:
[System.Xml.Serialization.XmlRootAttribute(Namespace="http://tempuri.org/Chris.xsd", IsNullable=false)]
Do I have to have this xmlns deal in that line or what?
You can simply use
[System.Xml.Serialization.XmlRootAttribute]
or
[System.Xml.Serialization.XmlRootAttribute(IsNullable=false)]
--
Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
.
- Prev by Date: Re: .NET's internal Source Code
- Next by Date: XMLDocument Parsing Issue in VB.NET
- Previous by thread: XML DOM wierdness? (from a newbie)
- Next by thread: Re: Maddening working with .NET/.XSDs
- Index(es):
Relevant Pages
|