Which is the better way of representing in XML?

Hi
I have kept all the messages of my application in a XML like this.

<Module id ="1" name ="FileProcess">
    <Message id ="1">Started processing the input file...</Message>
    <Message id ="2">Stopped processing the input file</Message>
    <Message id ="3">Input File is Valid</Message>
  </Module>

But, what is the difference between the above and the below. In the above one I kept the message in between the tags. Below, I kept the messge as an attribute. So which is better way?

 <Module id ="1" name ="FileProcess">
    <Message id ="1" msg ="Started processing the input file..." />
    <Message id ="2" msg ="Stopped processing the input file" />
    <Message id ="3" msg = "Input File is Valid" />
 </Module>

Which is better and why?
Can anyone explain me clearly?
GouthamAnandAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

SreejithGCommented:
Second one is better. Reason : - The message can be of multi line. Attribute value doesnot support multi line string. Also can have some chars that a attribute value doesnot support.
0
GouthamAnandAuthor Commented:
Why the second one is better, when you are saying that it does not support 'multiline string' and special charecters ?
0
GouthamAnandAuthor Commented:
Which are the charecters that it does not support , if I choose the second option.
0
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

SreejithGCommented:
Opps, sorry
First one is better
0
SreejithGCommented:
OK I will put in another way. You can have CDATA node under the Node and have any chars. But in attribute value you need to escape these .
0
GouthamAnandAuthor Commented:
Can you give me an example for this.
0
SreejithGCommented:
here it is
<Module id ="1" name ="FileProcess">
    <Message id ="1">Started processing the input file...in < 10 sec</Message>
    <Message id ="2">Stopped processing the input file</Message>
    <Message id ="3">Input File is Valid</Message>
  </Module>
Above XML is invalid. You can make it valid as below or by escaping the <  to &lt;
<Module id ="1" name ="FileProcess">
    <Message id ="1"><![CDATA[ Started processing the input file...in < 10 sec ]]></Message>
    <Message id ="2">Stopped processing the input file</Message>
    <Message id ="3">Input File is Valid</Message>
  </Module>

Open in new window

0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GouthamAnandAuthor Commented:
Thank you.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.