Re: Maddening working with .NET/.XSDs



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!



.



Relevant Pages

  • RE: Creating Schema for Flat File Disassembler
    ... I have resolved the issue of consuming and parsing the document into an XML, ... > 1- you must ensure that the schema match's the flat file documents instance. ... >> I am working on an issue where I need to parse a positional flat file into ...
    (microsoft.public.biztalk.general)
  • Re: Anyone using Berkley XML DB w/Perl (of course)...?
    ... > Chris wrote: ... >> though an article I read on XML DB claims there is Perl support. ... I'd *really* like to play with this XML DB some... ... I'll download the Linux source and follow the lead I was given and see ...
    (comp.lang.perl.misc)
  • Re: writing xml files with a schema
    ... How would you place attributes of an element in the XML document??? ... Chris DeBoer wrote: ... >> To construct this in MATLAB, ... I can make a real nice schema in VS to verify my ...
    (comp.soft-sys.matlab)
  • Re: writing xml files with a schema
    ... How would you place attributes of an element in the XML document??? ... Chris DeBoer wrote: ... >> To construct this in MATLAB, ... I can make a real nice schema in VS to verify my ...
    (comp.soft-sys.matlab)
  • Re: [PHP] XML & HTTP
    ... Chris Shiflett wrote: ... >> I generated XML file. ... ways to send an XML file. ... is supposed to receive the XML document? ...
    (php.general)