D
Daniel
Hi,
I have a collection, which is a property of a class:
public class PostcodeCollection : CollectionBase
{
// ...collection specific properties
[XmlAttribute("Total")]
public int Total
{
get { return List.Count; }
set {}
}
}
The main class is:
[XmlRoot("PostCodes" )]
public class PostcodeReport
{
// ..other properties
[XmlArray("Updated")]
[XmlArrayItem(typeof(PostCodeLine), ElementName="PostCode")]
public PostcodeCollection Updated
{
get { return this.updated; }
}
}
I want to add the "Total" property as an attribute to "Updated" node.
Using "XmlAttribute" on the property, doesn't do the trick.
This is how the xml must look like:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='PostcodeUpdates.xslt'?>
<PostCodes Generated="03-05-2007, 17:50">
<Added />
<Updated Total="23" >
<PostCode District="2031"... />
</Updated>
</PostCodes>
How can i do this?
Many thanks,
Daniel
I have a collection, which is a property of a class:
public class PostcodeCollection : CollectionBase
{
// ...collection specific properties
[XmlAttribute("Total")]
public int Total
{
get { return List.Count; }
set {}
}
}
The main class is:
[XmlRoot("PostCodes" )]
public class PostcodeReport
{
// ..other properties
[XmlArray("Updated")]
[XmlArrayItem(typeof(PostCodeLine), ElementName="PostCode")]
public PostcodeCollection Updated
{
get { return this.updated; }
}
}
I want to add the "Total" property as an attribute to "Updated" node.
Using "XmlAttribute" on the property, doesn't do the trick.
This is how the xml must look like:
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type='text/xsl' href='PostcodeUpdates.xslt'?>
<PostCodes Generated="03-05-2007, 17:50">
<Added />
<Updated Total="23" >
<PostCode District="2031"... />
</Updated>
</PostCodes>
How can i do this?
Many thanks,
Daniel