![]() |
VOOZH | about |
The XML elements are the basic building block of the XML document. It is used as a container to store text elements, attributes, media objects etc. Every XML documents contain at least one element whose scopes are delimited by start and end tags or in case of empty elements it is delimited by an empty tag.
Syntax:
<element-name attributes> Contents...</element-name>
Example:
name="Geeks" Here, Geeks represents the value of attribute
Rules to define XML elements: There are some rules to create XML elements which are given below:
Empty Elements: An element in XML document which does not contains the content is known as Empty Element. The basic syntax of empty element in XML as follows:
<elements-name attributename/>
Example 1: Following is the example of an XML document describing the address of a college student using XML elements.
Output:
G4G Geeksforgeeks 2345456767
Example 2:
Output:
xyz abc 80% 98%