How to define XML Element?

How to define XML Element?

 Everything inside the open and closed tag is called as XML Element.It may be contain other element and text or may be a combination of both.

I have given you example which help you to understanding element in XML.

<bookstore>

   <book category=\"JAVA\">

      <title lang=\"en\">The Complete Reference </title> 

      <author>Herbert Schildt</author>     

      <year>2005</year>

      <price>30.91</price>

   </book>

   <book category=\"C++\">  

      <title lang=\"en\">Programming in ANSI C++</title>   

      <author>E Balaguruswamy</author>    

      <year>2007</year>   

      <price>38.99</price> 

   </book>

   <book category=\"C\">  

      <title lang=\"en\">Exploring C</title>   

      <author>Yashwant kanetkar</author>   

      <year>2006</year>   

      <price>42.95</price> 

   </book>

</bookstore> 

 Above,bookstore and book both are element content where as title,author,year and price are text content.book also called as attribute and JAVA,C++ and C is the value of book attribute.


By:Vivek
Date:2014-01-09 00:00:00

Post Your Answers


User Email:

User Name:
Answers:

Related XML Subjective Links

XML Subjective interview questions and answers for experienced and fresher