April 18, 2009

0 Store data in child elements in XML

The following three XML documents contain exactly the same information.

A Date attribute is used in the first example:

<note date="12/11/2002">
<to>Rasik</to>
<from>Bapotra</from>
<heading>Reminder</heading>
<body>Dont't forget me this weekend! </body>
</note>






Rasik
Bapotra
Reminder

Dont't forget me this weekend!




A date element is used in the second example:


<note>
<date>12/11/2002</date>
<to>Rasik</to>
<from>Bapotra</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend! </body>
</note>




12/11/2002
Rasik
Bapotra
Reminder
Don't forget me this weekend!




An expanded date element is used in the third: (ThIS IS MY FAVOURITE):


<note>
<date>
<day>12</day>
<month>11</month>
<year>2002</year>
</date>
<to>Rasik</to>
<from>Bapotra</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend! </body>
</note>






12
11
2002

Rasik
Bapotra
Reminder
Don't forget me this weekend!


0 comments:

Post a Comment

Blogger Themes

 
Powered by Blogger