Each XML document has exactly one single root element. It encloses all the other elements and is, therefore, the sole parent element to all the other elements. ROOT elements are also called document elements. In HTML, the root element is the <html> element.[1]
The World Wide Web Consortium defines not only the specifications for XML itself,[2] but also the DOM, which is a platform- and language-independent standard object model for representing XML documents. DOM Level 1 defines, for every XML document, an object representation of the document itself and an attribute or property on the document called documentElement. This property provides access to an object of type element which directly represents the root element of the document.[3]
There can be other XML nodes outside of the root element.[4] In particular, the root element may be preceded by a prolog, which itself may consist of an XML declaration, optional comments, processing instructions and whitespace, followed by an optional DOCTYPE declaration and more optional comments, processing instructions and whitespace. After the root element, there may be further optional comments, processing instructions and whitespace within the document.[5]
Within the root element, apart from any number of attributes and other elements, there may also be more optional text, comments, processing instructions and whitespace.
A more expanded example of an XML document follows, demonstrating some of these extra nodes along with a single rootElement element.
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE example [<!ENTITY copy "©">]>
<rootElementattribute="xyz"><contentElement/></rootElement><!-- comment nodes may appear almost anywhere -->
^"4 The elements of HTML — HTML5". www.w3.org. Retrieved 2017-10-10.
^The current W3C XML 1.0 specification
^The 'documentElement' definition in the W3C DOM Level 1 specification
^The 'well-formed document' section of the W3C XML specification
^The 'prolog' section of the W3C XML specification
exactly one single rootelement. It encloses all the other elements and is, therefore, the sole parent element to all the other elements. ROOT elements are...
other words if an element a square root u of an element a exists, then the only square roots of a are u and −u. The only square root of 0 in an integral...
operations, such as getElementById, createElement, appendChild, and innerHTML. // Create the rootelement var root = document.createElement("root"); // Create a...
declaration is: <!DOCTYPE root-element PUBLIC "/quotedFPI/" "/quotedURI/" [ <!-- internal subset declarations --> ]> or <!DOCTYPE root-element SYSTEM "/quotedURI/"...
as a tree structure, called an XML tree. XML documents must contain a rootelement (one that is the parent of all other elements). All elements in an XML...
heap, which was damaged by replacing the root, is repaired so that the greatest element is again at the root. This repeats until only one value remains...
development programs provide code validation based on the W3C standards. The rootelement of an XHTML document must be html, and must contain an xmlns attribute...
but it is still there. For example, an HTML document always has a root <html> element, even if the string <html> doesn't appear anywhere in the markup...
mathematics, the term primitive element can mean: Primitive root modulo n, in number theory Primitive element (field theory), an element that generates a given...
English. In more detail, the rootelement of the document is book. All DocBook elements are in an XML Namespace, so the rootelement has an xmlns attribute...
elements may be different from the implied rootelement), and it indicates the type name of the rootelement: <?xml version="1.0" encoding="utf-8"?> <...
represented as a tree with a rootelement representing →{\displaystyle \to }. Among the attributes of the rootelement are pointers to the two elements...
When an XML parser loads this document, it sees that it includes one rootelement, "lolz", that contains the text "&lol9;". However, "&lol9;" is a defined...
and a "book" document. Both of these use a "title" element, but the meaning is not the same: <root> <person> <fname>Nancy</fname> <lname>Davolio</lname>...
return the top element of the heap. meld: compare the two root elements, the smaller remains the root of the result, the larger element and its subtree...
character, and cannot begin with "-", ".", or a numeric digit. A single rootelement contains all the other elements. The definition of an XML document excludes...
content of an element be controlled by one of its siblings. Or it can request or require that the rootelement, regardless of what element that is, must...
distinguish it clearly from the more traditional definition. However, the rootelement name continues to be "html" even in the XHTML-specified HTML. The W3C...
book's metadata, file manifest, and linear reading order. This file has a rootelement package and four child elements: metadata, manifest, spine, and guide...
of the root system (e.g., a 60-degree rotation is a symmetry of the root system but not an element of the Weyl group). There is only one root system of...
<opml version="1.0"> This is the rootelement. It must contain the version attribute and one head and one body element. <head> Contains metadata. May include...