473,395 Members | 1,471 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,395 software developers and data experts.

Attributes on ArrayItems Serialization

12
Hi

I have manged to generate this xml

Expand|Select|Wrap|Line Numbers
  1. <COSTPRICE>
  2.         <COST>45.67</COST>
  3.         <COST>46.67</COST>
  4.         <COST>2.67</COST>
  5. </COSTPRICE>
  6.  
Using this VB.net 2.0 serialization

Expand|Select|Wrap|Line Numbers
  1. <XmlArrayAttribute("COSTPRICE")> <XmlArrayItem(ElementName:="COST")> Public Cost() As Double
  2.  
What would I need to do to get

Expand|Select|Wrap|Line Numbers
  1. <COSTPRICE>
  2.         <COST duration="7">45.67</COST>
  3.         <COST  duration="2">46.67</COST>
  4.         <COST  duration="2">2.67</COST>
  5. </COSTPRICE>
  6.  
I have seen something called xmlarrayitemattribute but im not sure how to use it here.

Regards
Bennett
Jul 7 '07 #1
1 889
kenobewan
4,871 Expert 4TB
Here is an article that may help:
Rotor Source code
Jul 7 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: Christopher Ambler | last post by:
I have a class that I deserialize into as such: public class row { public string RecordFound; public string IsExpired; }
2
by: Mike LeBlanc | last post by:
Hi, I have a desired xml output that looks like this <?xml version="1.0" encoding="UTF-8"?><onhand_request><item organization_id="414">1</item><item...
1
by: Daniel Lidström | last post by:
Hi, is there a way to control the order XmlSerializer serializes attributes? With this class, value is serialized before value. Although it shouldn't matter, I would like it the other way...
1
by: Daniel Lidström | last post by:
Hi, I want to know how I can deal with empty attributes, like this example: <Spiral constant=""> </Spiral> My Spiral implementation contains this code: bool constantSpecified;
6
by: A.M | last post by:
Hi, I am trying to grasp a better underestanding of C# Attributes . I don't see them as a very usefull capability. Could anyone refer me to resources show me best practices and how can I...
3
by: Paulo Morgado [MVP] | last post by:
Hi all ..NET Framework 1.1 I have created several types that are serailized to XML as strings. Someting like this: public struct MyInt32 : IXmlSerializable { int value;
2
by: Glenn | last post by:
Hi Here's the scenario... I have a web method to which a pass a customer ID. The web method looks up the customer and returns an XmlNode which I deserialise into a type. I then update...
2
by: jamie | last post by:
Perhaps I'm using this wrong. When I use above an attribute I don't want serialized it ignores the attribute. It also ignores some other attributes. Have I done something wrong? Here's...
2
by: Jon Jon | last post by:
1st please forgive me if I posted this to the wrong news group(s), news group guidance would be appreciated. Question: I have the following sample class generated from XSD.exe (Vs 2005). I...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.