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

Serialisation > construct objects

Hi everybody

what are the objets for the folowing XML serialisation :
(I have problem with "name" and "datatype")

<vehicule type="car">
<name datatype="String">Megane</name>
</inventory>

I Have this :

class vehicule
<xmlattributeattribute()> public type as string
public name as string
end class

But where do I put 'datatype' for "name'????

Thanks a lot

Lobrys
Nov 11 '05 #1
2 1366
you need two classes to serialize the content of car, vehicule cannot be a
string since it has XML content. For example:

<XmlRoot("vehicule")>
Public Class
Public Name as VehiculeData
EndClass

Public Class VehiculeData
<XmlAttribute> Public datatype as String
<XmlText> Public Description As String
End Class

HTH,
Christoph Schittko
Software Architect, .NET Mentor
MS MVP XML .NET
"lobrys" <lo**********@free.fr> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Hi everybody

what are the objets for the folowing XML serialisation :
(I have problem with "name" and "datatype")

<vehicule type="car">
<name datatype="String">Megane</name>
</inventory>

I Have this :

class vehicule
<xmlattributeattribute()> public type as string
public name as string
end class

But where do I put 'datatype' for "name'????

Thanks a lot

Lobrys

Nov 11 '05 #2
Thanks a lot for the reply
It was exactly what i was looking for...




"Christoph Schittko [MVP]" <ch********************@austin.rr.com> a écrit
dans le message de news:e5**************@TK2MSFTNGP12.phx.gbl...
you need two classes to serialize the content of car, vehicule cannot be a
string since it has XML content. For example:

<XmlRoot("vehicule")>
Public Class
Public Name as VehiculeData
EndClass

Public Class VehiculeData
<XmlAttribute> Public datatype as String
<XmlText> Public Description As String
End Class

HTH,
Christoph Schittko
Software Architect, .NET Mentor
MS MVP XML .NET
"lobrys" <lo**********@free.fr> wrote in message
news:eG**************@TK2MSFTNGP10.phx.gbl...
Hi everybody

what are the objets for the folowing XML serialisation :
(I have problem with "name" and "datatype")

<vehicule type="car">
<name datatype="String">Megane</name>
</inventory>

I Have this :

class vehicule
<xmlattributeattribute()> public type as string
public name as string
end class

But where do I put 'datatype' for "name'????

Thanks a lot

Lobrys


Nov 11 '05 #3

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

Similar topics

1
by: lobrys | last post by:
Hi everybody here is a question I have this class that a want to serialize : Public Class BOO <XmlAttributeAttribute()> Public THING As String <XmlElementAttribute("param")> Public p() As...
7
by: Danny Tuppeny | last post by:
Hi All, I've been going through Google Groups, but nothing seems to quite match my problem. It's hard to post a WSDL or anything at the moment (it's not my service, I'm just using it), but maybe...
7
by: utab | last post by:
Dear all, I tried sth like this, compiles but segmentation fault error. In my reasoning field_values holds a vector<double> but when I tried, I understood that it is not the case :-). ...
2
by: Greg | last post by:
I have a bizarre situation in which serialisation is failing routinely under a specific condition, and I'm wondering if the details ring a bell with anyone here. I have 2 classes that my...
10
by: dragoncoder | last post by:
Hi all, I am trying to understanding std::auto_ptr<Tclass implementation from "The C++ standard library" by Nicolai Josuttis. He gives a sample implementation of auto_ptr class template in...
6
by: Martin | last post by:
Hi I need to maintain a <setof pointers to objects, and it must be sorted based on the values of pointed objects, not pointer values. I can achieve this easily by defining my own comparing...
2
by: ashwinij | last post by:
Hello The steps which i am doing in my program 1) I am having an xml file. 2) I am performing some updations in the file using XQueryUtil class from nux package. 3)After that i am...
3
by: Rotsey | last post by:
Hi, I am trying to send a object to a webservice and I get an serialisation error on the object saying "object not expected" add "XmlInclude or SoapInclude attribute" I have done this but...
2
by: Ward Germonpré | last post by:
Hi, I'm reading up on serialising objects, and came across links to db4o, an object oriented database. Can anyone point out articles/blogs comparing PHP's serialisation process and storing...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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.