XML deserialization problem (C# - Silverlight 2.1)

Hello,
I'm currently trying to deserialize the following:

XSD:
<?xml version="1.0" encoding="utf-8"?>
<xs:schema id="Inventory"
    targetNamespace="http://tempuri.org/Inventory.xsd"
    elementFormDefault="qualified"
    xmlns="http://tempuri.org/Inventory.xsd"
    xmlns:mstns="http://tempuri.org/Inventory.xsd"
    xmlns:xs="http://www.w3.org/2001/XMLSchema"
>
    <xs:element name="Inventory">
        <xs:complexType>
            <xs:sequence>
                <xs:element name="Slot" minOccurs="0"
maxOccurs="unbounded">
                    <xs:complexType>
                        <xs:sequence>
                            <xs:element name="SStat" minOccurs="0"
maxOccurs="unbounded" nillable="1">
                                <xs:complexType>
                                    <xs:attribute name="SType"
type="xs:short" use="required"/>
                                    <xs:attribute name="SEffect"
type="xs:short" use="required"/>
                                    <xs:attribute name="SValue"
type="xs:short" use="required"/>
                                </xs:complexType>
                            </xs:element>
                        </xs:sequence>
                        <xs:attribute name="IID" type="xs:int"
use="required"/>
                        <xs:attribute name="Amount" type="xs:short"
use="required"/>
                        <xs:attribute name="Number" type="xs:short"
use="required"/>
                    </xs:complexType>
                </xs:element>
            </xs:sequence>
        </xs:complexType>
    </xs:element>
</xs:schema>

XML:
<?xml version="1.0" encoding="utf-16"?>
<Inventory>
 <Slot IID="1" Amount="1" Number="22">
  <SStat SType="0" SEffect="1" SValue="5" />
  <SStat SType="1" SEffect="1" SValue="1" />
 </Slot>
</Inventory>

The deserialization works fine, and reads in the inventory and slot
object, but fails to load the SStat objects and instead put in a null
array.

Anyone?

*** Sent via Developersdex http://www.developersdex.com ***
0
admin2281 (1)
9/16/2008 2:11:59 AM
dotnet.xml 7266 articles. 0 followers. Follow

0 Replies
795 Views

Similar Articles

[PageSpeed] 10

Reply:

Similar Artilces:

XML Header
Hi, I have some XML doc loaded in a C# Web Service. XmlDocument doc = new XmlDocument(); doc.LoadXml(myDoc); Code Missing to manipulate header (I would like to replace or manupulate all these XXXXX): <mso-XXXXXX productversion="XXXXXX"> <mso-application progid="XXXXX"?> doc.Save(myNewDoc); Any idea on how to access and manipulate data within the doc header? Thanks vbdev vb6dev2003 wrote: > I have some XML doc loaded in a C# Web Service. > XmlDocument doc = new XmlDocument(); > doc.LoadXml(myDoc); > > Code Missing to manipulate header ...

CDhtmlDialog Charset Problem
Hi, I am using a CDhtmlDialog with a HTML file to show some results in this dialog. The HTML file's head portion is given below :- <HEAD> <META http-equiv="Content-Type" content="text/html; charset=EUC-JP"> </HEAD> Note the charset mentioned as EUC-JP. I am using CDhtmlDialog::LoadFromResource() to load this HTML file in the CDhtmlDialog dialog. LoadFromResource is invoked from CDhtmlDialog::OnInitDialog(). Thus when the dialog is created the HTML file is loaded automatically. After this loading is done, I am writing some dynamic content in the H...

rules for 2 accounts #2
We're running Outlook 2002 on Exchange 2003. I need to check both my and webmster's email. Ideally, I want to create 2 server-side filters (so they are filtered when i open outlook): 1. Filter all email if the sender is not on my address book. 2. Filter email if it's BCC'd (since a lot of email comes that way. Then I want the rules to apply both my and webmaster's inboxes, and put the email in their respective Junk mail folders. However, this is what it's doing: Makes the rules client-side, so when I open outlook, my emails are not filtered (incoming email is,...

Recieving Domain.2 sending Domain.1
I have currently set up my Exchange 2003 server for 2 companies receiving 2 domain names everything is working fine except the users of domain name.2 are sending their e-mail out as user@domainname.1 how do I correct this so that they send out user@domainname.2? Thank you for your time On Fri, 29 Jul 2005 06:26:06 -0700, LaOVis <LaOVis@discussions.microsoft.com> wrote: >I have currently set up my Exchange 2003 server for 2 companies receiving 2 >domain names everything is working fine except the users of domain name.2 are >sending their e-mail out as user@domainname.1...

Problem opening excel 97
When I open Excel 97 I receive an error. Microsoft Visual Basic- Permission to use object denied. I have tried re- registering excel with no luck. Any other ideas? Thank you Chip Pearson has a WebPage that offers a variety of suggestions. http://www.cpearson.com/excel/StartupErrors.htm HTH Paul -------------------------------------------------------------------------------------------------------------- Be advised to back up your WorkBook before attempting to make changes. -------------------------------------------------------------------------------------------------------------- >W...

Illegal Operation #2
Everytime I send an email message, I get an illegal operation notice. This also happens when I delete emails. The following are examples of the details of the illegal operations. Does anyone know what I can do to correct this? OUTLOOK executed an invalid instruction in module <unknown> at 0000:00ff705e. Registers: EAX=00000000 CS=017f EIP=00ff705e EFLGS=00010297 EBX=00ff686c SS=0187 ESP=0056f1e0 EBP=0056f21c ECX=00ff686c DS=0187 ESI=0056f210 FS=22e7 EDX=00000000 ES=0187 EDI=00ff705c GS=0000 Bytes at CS:EIP: 8e 30 00 00 00 00 f4 68 ff 00 62 01 00 00 33 00 Stack dump: 00ff705c 00f...

Read XHTML into XML
Hi all, I need to read/parse XHTML aspx pages and look for certain tokens and content. How can I use a XmlTextReader for this? If not, any other ideas? Thanks in advance, JA Reyes. Jose Antonio Reyes wrote: > I need to read/parse XHTML aspx pages and look for certain tokens and > content. How can I use a XmlTextReader for this? If not, any other ideas? If the pages are well-formed XHTML then it is possible to use XmlReader (in .NET 2.0/3.0) or XmlTextReader (in .NET 1.x) to parse the XHTML documents. You can also use the other XML APIs .NET provides so using XPathNavigator and/o...

You cannot install Microsoft Office 2008 for Mac 12.0.1 Update on this volume
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: intel This error message comes up when trying to load on the 12.0.1 upgrade. "You cannot install Microsoft Office 2008 for Mac 12.0.1 Update on this volume. A version of the software required to install this update was not found on this volume." I have tried re-installing 2008 again and also all the other recommendations offered by Microsoft, but to no avail. Any ideas? It sounds to me like you don't yet have the 2.1.1 update to AutoUpdate which is required to install the Office 12.0.1 update. Download & ...

Spell Checker problem
I have Outlook Express installed by my supplier four years ago, but its Spell Checker is only for French and has no option for any other language. Is there a way out of this problem so that I can convert to English please? Conrad The below was posted by Bruce Hagen MS MVP and the credit does to him <snip> You no longer have spell checking capabilities in some languages in Outlook Express 6.0 after you install the 2007 Microsoft Office system: http://support.microsoft.com/kb/932974 Outlook Express cannot use the MS Word spell check in Office 2007. Downloading a free...

How to invoke the xml editor?
I installed vs2005 on a new xp pro machine, and installed everything except C++. When I click on a file with a ".xml" extension it is opened with IE. When I click file/Edit with XML Editor, it opens it with Notepad. If I click File/Open With and select XML Editor, it opens it with IE. So, where is the xml editor? Can it be invoked from withing VS? Where? Bill * billsahiker@yahoo.com wrote in microsoft.public.dotnet.xml: >I installed vs2005 on a new xp pro machine, and installed everything >except C++. When I click on a file with a ".xml" extension it is >opened ...

problems with portrait to landscape conversion while copying
I create a chart in XL in portrait mode. When I look at it in print preview it looks just as I would expect (i.e. tall and thin). However, as soon as I try to copy and paste it into either word or powerpoint it is converted into landscape format! I can't find any way to turn off this If you choose Edit>Paste Special>Picture, it should be pasted in Portrait orientation. Debbie wrote: > I create a chart in XL in portrait mode. When I look at > it in print preview it looks just as I would expect (i.e. > tall and thin). However, as soon as I try to copy and > ...

show XML schema and values
I have an XML document that looks like the following: <record> <Field1>value1</Field1> <Field2>value2</Field2> <Field3>value3</Field3> </record> What I'm aiming to do is to show the data in a report as in the following example: record: Field1 value1 Field2 value2 Field3 value3 The "Field1-3"-elements can have any name, so I'm trying to get a table that has in one result column the element name, and in the second colum...

problem when transferring out serialized item
we have a serialized item that was returned by a customer, and was placed into offline inventory. i went to offline inventory and transferred the item out, we did a standard transfer type (we are sending the item back to the supplier). after doing that, i went to the transfer out order, and selected issue all, and tried to commit to it. i get the error message "the following serial number exists in the database, and is not available for issuing: 04215494019" i checked this serial number in the serial table, and the status of the serial number is set at 3. we've never...

How do I get a graphy with 2 data sets to have 2 Y axis one for each data set?
How do I get a graphy with 2 data sets to have 2 Y axis one for each data set? On Jul 20, 5:26 am, libertyforall <r...@royhuff.com> wrote: > How do I get a graphy with 2 data sets to have 2 Y axis one for each > data set? Hi libertyforall, have a look at Jon Peltier's beatiful site, especially: http://peltiertech.com/Excel/Charts/ColumnsOnTwoAxes.html Have fun, cheers Michael ...

stupid question #2
i have a spreadsheet that the last person working on it put last name and first name in the same cell i would like it to have a last name column and a first name column. is it possible to split the contents with out having to retype it all. P.S. there are over 1000 entries ;O) Select the cells with names in and then:- data|text to columns and use the wizard Mike "Kimberly" wrote: > i have a spreadsheet that the last person working on it put last name and > first name in the same cell i would like it to have a last name column and a > first name column. > is it p...

Mouse flicker problems in MS Word, ,running windows 7.
I recently installed MS Office Home and Student on a windows 7 operating pc - but everytime I start word my curser flickers in the screen area and i can't click right or left. I don't know what to do to fix this problem. Any ideas would be appreciated. It isn't a Word problem, but my suspicion is either the printer driver is corrupt or incompatible or missing. Make sure that you have the latest driver for your printer and then delete and reinstall the printer. -- Terry Farrell - MSWord MVP "PR100" <PR100@discussions.microsoft.com> wrote in messag...

Beginner question #2
Please forgive what might be a beginner question. I have a spread sheet that is made up of 10 columns. I would like to make it so that each time I change a number in these columns, the sub-total at the bottom of each column changes automatically AND so that the sub-total in the far right column changes automatically. Is there a template for this?? Thanks so much!!! You would use a function for that, lets say you have values in A1 to A10, then in A11 place this =SUM(A1:A10), or =A1+A2+A3+A4+A5+A6+A7+A8+A9+A10. got the idea?? "jenny" <jenny@hotmail.net> skrev i melding ne...

Offline synch using XML web-services
This is a bit long-winded. Can somebody read thru these 2 use cases, and tell me if it is feasible ? :- Use Case : Replication before Offline Synch Scenario 1 : Oracle Server , MSDE client 1. User clicks on 'Go Offline'. System creates a MSDE SQL database in laptop (client), gets the schemas of the tables in Oracle, creates corresponding tables in client's MSDE SQL (mapping Oracle datatypes to SQL datatypes). 2. Offline replication program reads in the tables of the server into a typed datasets, converts the typed datasets into XML, and stores the XML in the client. (XML serial...

Problems with send to
Hello, we have the following problem. There is a worddocument published at our intranet. When i open this document an choose then 'send to', Outlook is starting and a new mail is created with a doc- file attached. But there are some users, if they open this document an choose 'send to', they create a new mail with a attached html-file (doc.htm) Where can i change this behavior.I want always send a doc- file. We are using Outlook2000 with Microsoft-Rich-Text as Emaileditor. The behavior is independent from the IE-version. All help is welcome Thank you Henrik I ca...

Lineage 2 interlude
�� request, ������, ���� ������������. ��������� ����. �� ����. Είστε ευπρόσδεκτοϊ -- Bob Larson Access World Forums Super Moderator Utter Access VIP Tutorials at http://www.btabdevelopment.com If my post was helpful to you, please rate the post. __________________________________ "Βαγγέλης" wrote: > Το request, τελικά, είχε αποτελέσματα. Ευχαριστώ πολύ. > Τα λέμε. > > ...

problem installing a system-wide hook
I am having trouble installing a system-wide hook (WH_CBT) using SetWindowsHookEx. I have build a DLL which contains my hook procedure and I dynamically load this DLL in my calling application, get the hook proc address, and call SetWindowsHookEx with the thread parameter as NULL. However, when I debug, the hook proc only gets called when windows are created, deactivated, etc for my application, instead I wanted the proc to be called for ANY window creation, activation, etc. I have tried a number of things but I don't understand why I am only able to hook events of my calling application i...

Contacts problem after running ADC?
We have a 2000 domain sp4, and a 5.5 sp4 machine on a 2000 server sp 4. We are getting ready to set up 2003 exchange and on a 2003 server and then migrate the mailboxes over. We have installed 2003 and then installed the connector on the 2003 machine, but we have not installed 2003 Exchange. I ran Active Directory Connector and now there are 2 problems? 1. On the global directory in Outlook there are 2 entries for every person, one e-mail address and one (what looks like a) custom recipient, how do I get rid of them? 2. Names are not being resolved when you type them in the to: spa...

XML Serialization ... how to truncate <?xml...
While xml serializing object how can I truncate <?xml ...?> this line alone? I need to send the serialized xml data to a web method ... since SOAP already have <?xml tag there was some confusion Any help would be greatly appreciated Thank you Regards Raj Raj wrote: > While xml serializing object how can I truncate <?xml ...?> this line alone? Serialize to an XmlWriter created with XmlWriterSettings where you set OmitXmlDeclaration to true. -- Martin Honnen --- MVP XML http://msmvps.com/blogs/martin_honnen/ ...

Import multiple sheet spreadsheet #2
I am importing a single comma delimited text file into Excel 2002 SP3. The final spreadsheet will encompass multiple sheets. What is the delimiter to tell Excel to move on to the next sheet? Thanks for any help. ...

String to xml document
Hi there, I was hoping someone can help me with a little problem I can't seem to find any answers to. I've got a form wich will be posted. On receiving the post I would like to parse a formvar to a xml document. The contents of this formvar (string) will be a valid xhtml document. Can someone give me a startertip (or more :-)) on how to achieve this? tnx in advance, James van der Veen Sjeems wrote: > I was hoping someone can help me with a little problem I can't seem to find > any answers to. > > I've got a form wich will be posted. On receiving the p...