XML information pipe

Ihre Spezialisten für XML

Banner Werbung

Root element

Description:
An XML document is valid if it has an associated document type definition and if the document complies with the constraints expressed in it. The document type definition must appear before the first element in the document. The name following the word DOCTYPE in the document type definition must match the name of root element.

Examples


DTD

A document can contain only the root element tutorial which can contain some text. :

<!ELEMENT tutorial (#PCDATA)>



Valid documents

A valid document containing some text.:

<!DOCTYPE tutorial SYSTEM "tutorial.dtd">
<tutorial>This is an XML document</tutorial>


This document is also valid.:

<!DOCTYPE tutorial SYSTEM "tutorial.dtd">
<tutorial/>



Documents with errors

Root element does not conform to the given DTD.:

<!DOCTYPE tutorial SYSTEM "tutorial.dtd">
<text>This is an XML document</text>