C# and XML

Helping with C# and XML

Page 1 of 1

3 Replies - 1097 Views - Last Post: 18 July 2010 - 07:25 AM Rate Topic: -----

#1 Guest_Oded Goldberg*


Reputation:

C# and XML

Posted 17 July 2010 - 02:09 PM

Hey i Need Help
i have a 3d game in C#
which include Figure files
that one of them is xml file and other is jpeg
the xml file continues (vertex x y z and points ) and the jpeg is a image blend pic

i want to know how do create my own Xml file and

plz help me how do i do exact thing in the files?
*EMAIL REMOVED*

Attached image(s)

  • Attached Image

Attached File(s)


Is This A Good Question/Topic? 0

Replies To: C# and XML

#2 KYA  Icon User is offline

  • g++ jameson.cpp -o beverage
  • member icon

Reputation: 3101
  • View blog
  • Posts: 19,141
  • Joined: 14-September 07

Re: C# and XML

Posted 17 July 2010 - 02:12 PM

First, posting your email in a post is not a very good idea. Second, you need to be more specific on what exactly you want to do with the XML files. If you know the exact structure ahead of time, all you need to do is decide on the parser and how to store the information.
Was This Post Helpful? 0
  • +
  • -

#3 Guest_oded goldberg*


Reputation:

Re: C# and XML

Posted 17 July 2010 - 02:19 PM

can i get ur so i will explain to u exactly what i need?
i have a game ready on c#
and what i need to do is to change the figure as seen in the jpeg file
and i am wondering how do i do that?

the xml file like attached here in the blog ''' how do i create him with (which program that export xml exact and show in the attach file)

may you help me?

or will u write me or email me
Tnx alot

appreciate it
Was This Post Helpful? 0

#4 Core  Icon User is offline

  • using System.Linq;
  • member icon

Reputation: 774
  • View blog
  • Posts: 5,097
  • Joined: 08-December 08

Re: C# and XML

Posted 18 July 2010 - 07:25 AM

Basically, a XML file can be written in three ways for your specific situation:

  • By manually formatting the XML
  • By using automatic XML formatting via XmlTextWriter
  • By serializing an existing class via XmlSerializer


The first way means that you will manually build the XML string. It is definitely not what you want to do for large XML files since this might lead to invalid XML formatting that will render the generated content unusable.

By using XmlTextWriter you can clearly define the XML structure. This pretty much cuts out any possible formatting errors, but still you will manually set the node sequence, so you got to be careful about that.

There are two articles that you should read on this subject:
Well-Formed XML Creation with the XmlTextWriter
Writing XML with the XmlWriter

The last and probably the most simple method is to serialize an existing class. So if you already have the vector data stored in a class instance, you can simply serialize the existing structures via XmlSerializer.

You can read more about serialization here:
Introducing XML Serialization
Was This Post Helpful? 3
  • +
  • -

Page 1 of 1