Computer Science, asked by PranjitDas275, 1 year ago

What is the root element?

Answer Please...☺​

Answers

Answered by gparasuram606
1

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.

The World Wide Web Consortium defines not only the specifications for XML itself, 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.

<parent>

  <child>content</child>

  <child attribute="att"/>

</parent>

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 "&#xA9;">]>

   

<rootElement attribute="xyz">

  <contentElement/>

</rootElement>

 

<!-- comment nodes may appear almost anywhere -->

Answered by vermalaxmi8181523
0

Explanation:

Root element are include the HTML tag are also called container tag. e.g. - < HTML>

Similar questions