Re: Deserialize from SelectSingleNode

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Geoff (geoffbishop_at_gmail.com)
Date: 11/19/04


Date: 19 Nov 2004 09:02:47 -0800

OK. I got this working finally! Cool. Thank you.

The Serializer.Deserialize() method kept giving me "XXX was not
expected."

I thought it was talking about the namespace for XXX, but it was
actually complaining about the entire element. Why?... Apparently
because my class name didn't exactly match the element in the XML
file.

Unfortunately, my class name was generated from an XSD file for the
XML file I'm working with. The class name has the form AAABBBCCC,
where the actual element I'm interested in, CCC, is nested under
elements AAA and BBB. I really don't want to change it, to match the
element, because if the XSD changes in the future, I will use the
xsd.exe tool to regenerate the classes, and any manual changes I've
made will get blasted.

Maybe there is an option for xsd.exe to generate class names which
match the element names, or maybe there is a way to do the
Deserialize() without the names matching. ???



Relevant Pages

  • Cant deserialize when root node has a qualified name
    ... the main XSD file (which just gathers pieces from the ... That worked fine in a different XML file, ... The prefix is different, but both XSD files have the same ... namespace in that XML file, I got an error deserializing to the effect ...
    (microsoft.public.dotnet.xml)
  • Re: cant create schema for qualified attributes in element with default namespace
    ... in your XML file you are using namespace prefix e3 without defining ... > I'm trying to regnerate the xsd I already have because I changed the xml> file on which the schema was based. ... > where the attributes are in a different name space to the element (NB> element prefix is now e3), but on creating the schema for this doc, I am> simply told e3 is an undeclared namespace. ...
    (microsoft.public.dotnet.xml)
  • WriteXML and xmlns attribute
    ... I have a dataset in my application that I write to an XML file using ... The resulting XML file has a xmlns namespace attribute as ... try to make the WriteXML method to omit the namespace attribute ...
    (microsoft.public.dotnet.languages.csharp)
  • Could someone help me out with my namespace problems in my XSD
    ... all I get for output are the headers I defined in the xsl. ... take-away the xmlns declaration in my xml file and it doesn't look for the xsd and ... --> <!-- we determine a DOCTYPE, or document type definition for element 'database' of a file external to the 'SYSTEM', named in the double quotes <title>Molecular Database--> <!-- ... The key is the xmlns namespace, you can massacre everything else it seems. ...
    (comp.text.xml)
  • RE: ReadXML and data types
    ... If I want to put the schema in a separate XSD file, ... with my XML file for ReadXml to use? ... > Kevin Yu ...
    (microsoft.public.dotnet.xml)