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

Simple XML Serialization question

Hi.
I'm using XML Serialization in my app, but have one tiny problem:
I've declared a string with the [XMLElement].
So then I get the string when tje XML looks like this:
<item>
<price currensy="USD">10</price>
<item>
But now I want to add a attribute to this
How do I use
Nov 16 '05 #1
1 1009
a litle problem when maikng the last post, sorry.
Here is the right one:
I'm using XML Serialization in my app, but have one tiny problem:
I've declared a string with the [XMLElement].
So then I get the string when tje XML looks like this:
<item>
<price currensy="USD">10</price>
<item>

But i now want to add an attribute, like this:
<item>
<price currensy="USD">10</price>
<item>
I'd like to just define this attriute (as a string) in the main class,
without the need of making a new "price" class/struct
Nov 16 '05 #2

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

Similar topics

3
by: Aamir | last post by:
Hi, Quick Question: How to create a simple XML with US States list and read it into a combo box. Detail: I am very new to Dot Net technology as well as xml. I am building a desktop app in...
3
by: Aaron Clamage | last post by:
Hi, I'm not sure that if this is the right forum, but any help would be greatly appreciated. I am porting some java serialization code to c# and I can't figure out the correct way to do it. ...
1
by: Farouche | last post by:
Hi all I have made two simple methods to serialize/deserialize a simple data structure to my database using SoapFormatting. This actually works just great, when the structures stays the same....
6
by: John Glover | last post by:
I'm having a very strange problem with XML serialization. I'm writing web services which pass instances of various classes back and forth as parameters and return values of web methods. The...
11
by: jason | last post by:
we have developed a .NET class library that defines a family of reusable business objects. the class library is developed in C#, and works quite well. one problem, however, is that as more and...
2
by: Ron M. Newman | last post by:
Hi, I have a simple class that has a Hashtable. the hashtable has a couple of key/value pairs where the key is a string and the value is also a strong. I have at the top of that class. ...
5
by: raj | last post by:
I know what interfaces are and what they used for etc. Today i am learning about serilization. I know to mark the class "serializable" and implement ISerializable interface, and then implement...
0
by: groovyghoul | last post by:
Hi I have the following XML file: =========================================================== <?xml version="1.0" encoding="UTF-16"?> <Policy xmlns="http://tempuri.org/richard.xsd"> <TransType...
0
by: nobin01 | last post by:
Dear sir; I want ur Help in serialization.I know serialization.I Know binary,soap and xmlserialization also.But i want ur help in following topics.pls help me as soon as possible.I have search in...
6
by: pamela fluente | last post by:
Hi, please find below a very simple code snippet which is giving me the following error: System.Runtime.Serialization.SerializationException was unhandled Message="The constructor to deserialize...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.