Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Deserialization of Xml

Status
Not open for further replies.

Kalisto

Programmer
Feb 18, 2003
997
GB
Ive got a database that is producing xml data

say I have a class like below
Code:
public class foo
{
private string _name;
private decimal _data[];

[XmlAttribute("XmlName")]
public string Name
{
 get {return _name;]
 set {_name = value};
}

[XmlArray ("XmlData")]
public decimal Data{
 get {return _data;]
 set {_data = value};
}

}

then the class will deserialize the Name values correctly, but will not populate the array. As most of the above is boilerplate code from a tool, Im assuming its either my use of attributes, or my XML that is wrong

Code:
...
<foo XmlName = "bar">
  <Data>0.000</Data>
  <Data>0.001</Data>
  <Data>0.010</Data>
</foo>

Thanks

K
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top