473,403 Members | 2,071 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,403 software developers and data experts.

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 ***
Sep 16 '08 #1
0 2784

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: m.a | last post by:
Hello, I installed MSVC 2008 express and I like to install silverlight. Can I do this? Thenone that I got from silverlight web site, complain about msvc version. Regards
18
by: Artificer | last post by:
Any idea if MS will try to promote Silverlight over ASP.NET for web development or will silverlight remain just as a adobe's flash like tecnology?
0
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I have a web site under .NET 2.0 that renders videos using the Silverlight media player. The <asp:MediaPlayercontrol only works on .NET 3.5, but I managed to get things working under .NET 2.0 by...
1
by: Faisal Shafiq | last post by:
I want to upload a file direct to the Silverlight Streaming Service from a Web Client such as silverlight application. As per our product requirement we want to upload a .WMV file directly from...
7
by: Andrew | last post by:
Hi, I am using DataContractJsonSerializer to deserialize JSON string in C# objects but I am having a problem. Suppose I have a class: class Item { public ItemId Id { get; set; }
3
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
Note: My apologies for repeating this post from last week, but my nospam alias and profile account were incorrect. I think I have fixed this, so hopefully this post will trigger MS into a response...
7
Curtis Rutland
by: Curtis Rutland | last post by:
Building A Silverlight (2.0) Multi-File Uploader All source code is C#. VB.NET source is coming soon. Note: This project requires Visual Studio 2008 SP1 or Visual Web Developer 2008 SP1 and...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.