Tuesday 26 December 2017

How to Define an Attributes in XML

The XML elements can contain attributes to store data. Now here we understand how to Define an Attributes in XML creating an XML document name is xmlattributes.xml to learn how to define an Attributes in XML.

///// xmlattributes.xml file /////

<?xml version="1.0" encoding="UTF-8" standalone="yes"? >
<employees>
<firstname>jone</firstname>
<middlename>ni</middlename>
<lastname title="shinah"></lastname>
<birthday date="&lt;24/06/2001&gt;"></birthday>
<employees>

Here: The root element is employees, which contains four elements firstname, middlename, lastname, and birthday. The lastname and birthday elements have title and date attributes respectively. 

No comments:

Post a Comment