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

Serialize Element Order

Hello All,
I have a question: is it possible to set the order of the elements of
serialized object?

Lets say we have

Public Class Order
Public Price As Decimal
Private Quantity As Decimal
Public Readonly Property Total() As Decimal
Get
Return Quantity * Price
End Get
End Property
<System.Xml.Serialization.XmlElementAttribute("Add ress")> _
Public Address() As Address
End Class
Class Address
.......

When Serializing the class Order I expected the outcome to be in this order:

<Order>
<price />
<quantity />
<total />
<adress />
<Order>

But the <total> element is always serialized behind the Address element.

<Order>
<price />
<quantity />
<adress />
<total />
<Order>
(seems to be, because it as a Property)

I know to XML this is no problem but one of our partners is parsing the XML
as a Textfile and so will not find the expected Atribute.

Thanks in advance.
Jul 21 '05 #1
0 1272

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

Similar topics

0
by: IMS.Rushikesh | last post by:
Hi All, I want to serialize an object which contain the DataTable. As DataSet is MarshalByRef object and is serializable. I am using it directly. Even my data is also serialize and save it to...
0
by: | last post by:
The code is below.. I want to be able to override two classes to the same element name... I've commented out the code which I cant get to work... the base of the code is an extention of one of the...
2
by: Alex | last post by:
I have a XML node defined as such: <node element="data"/> this loads into my class correctly: class node { public string element;
5
by: David Sworder | last post by:
Hi, I've created a UserControl-derived class called MyUserControl that is able to persist and subsequently reload its state. It exposes two methods as follows: public void Serialize(Stream...
1
by: Craig Buchanan | last post by:
I am trying to serialize a class called Order to the ViewState. Order has one property called LineItems, which is an ArrayList. The ArrayList holds instances of a class named LineItem. Bother...
0
by: Lars | last post by:
Hello All, I have a question: is it possible to set the order of the elements of serialized object? Lets say we have Public Class Order Public Price As Decimal Private Quantity As Decimal...
4
by: Hone | last post by:
I'm trying to serialize/deserialize the XML for an RSS 1.0 Feed (i.e. RDF) and the root element, as required by the standard, looks like this: <rdf:RDF ...> </rdf:RDF> However, I've tried...
4
by: =?Utf-8?B?Qnlyb24=?= | last post by:
When I try to serialize an instance of the LocationCell below (note Building field) I get an error in the reflection attempt. If I remove the _Building field it serializes fine. I tried renaming...
8
by: Andy B | last post by:
I have the following code in a default.aspx web form page_load event. There seems to be a problem with line 5 (NewsArticle.Date = line). //create a news article NewsArticle NewsArticle = new...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

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.