Re: Maddening working with .NET/.XSDs
- From: "Keith Patrick" <richard_keith_patrick@xxxxxxxxxxxxxxxxxx>
- Date: Fri, 12 Jan 2007 15:22:49 -0600
Which version of xsd.exe are you using? When I generate a schema from a bit
of XML (although I typically leave out the <?xml?> part), I get:
// This source code was auto-generated by xsd, Version=1.1.4322.2032.
[System.Xml.Serialization.XmlRootAttribute(Namespace="", IsNullable=false)]
"cada0310" <cada0310@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:9DA0290E-D2C9-45EB-BB67-81ACCE73AAC3@xxxxxxxxxxxxxxxx
Hey there,
Just starting out messing with XML in .NET. I'm just trying to read some
simple XML that I'm using to pass data structures between programs.
Something like this:
<?xml version="1.0" encoding="utf-8"?>
<Chris>
<One>1</One>
<Two>2</Two>
</Chris>
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?
Thanks!
.
- Follow-Ups:
- Re: Maddening working with .NET/.XSDs
- From: cada0310
- Re: Maddening working with .NET/.XSDs
- Prev by Date: Re: .NET's internal Source Code
- Next by Date: Re: Maddening working with .NET/.XSDs
- Previous by thread: Re: Maddening working with .NET/.XSDs
- Next by thread: Re: Maddening working with .NET/.XSDs
- Index(es):
Relevant Pages
|