XML

XML Elements

Posted on 18th February 2014

Elements are the basic building blocks of a XML document. XML Elements are either container elements or empty elements. Container elements contain text or other elements.

All XML elements, except empty elements, will have a start tag, an end tag and some content between the start and end tags.

Start tags begin with an opening angle bracket < followed by the name of the element and a closing angle bracket >. The start tags may also contain attributes that define some property of the element.

End tags begin with an opening angle bracket and forward slash </ followed by the name of the element and a closing angle bracket >. The element name in the start and end tags should match.

Syntax of a XML container element is as shown below:

< Element_Name attribute1 attribute2 ...>
content
</ Element_name>

Empty XML elements have no content so they do not need a closing tag. Empty elements begin with an opening angle bracket < followed by the name of the element, any attributes, and a forward slash and closing angle bracket />.Empty XML Elements have the following syntax

< Element_Name attribute1 attribute2 .../>

Post a comment

Comments

Nothing yet..be the first to share wisdom.