- XML Tutorial
- how create xml file
- XML Elements
- XML Attributes
- XML Namespaces
- how view xml file
- XML File Encoding
- how style xml code
- XML Code File
- Valid XML File
XML Elements - what is xml element - use of xml element
what is xml element :- xml elements are the basic building blocks of xml and all documents will have at least one.xml elements can be extended to carry more information.
the xml document all elements are defined in one of two ways.
<tag_name> tag-content </tag_name>
self-closing element :- <tag_name />
xml element can contain :
- other elements
a xml file look like -
xml element naming rules
- element names must begin with a letter or an underscore( _ ).
- names can't contain spaces.
- names are case-sensitive, so the start and end tags must match exactly.
- names can't contain the colon(:) character.
- there can't be a space after the opening < character, the name of the element must come immediately after it.however there can be space before the closing > character if you desire.
legal and illegal elements.
|<first name></first name>||incorrect, because names cannot contain white spaces.|
|<3number></3number>||incorrect, because names cannot begins with a digit.|
|<second_name></second_name>||correct, underscore allowed.|
|<-name></-name>||incorrect, because hyphen is not allowed as the first character.|
|<sandeep></sandeep>||incorrect,start and end tag must match case-sensitive.|
|<!name></!name>||incorrect, operators not allowed(# $ % * ^ ~ = + !).|