XML information pipe

Ihre Spezialisten für XML

Banner Werbung

Elements in given order ( , )

Description:
An element type has element content when elements of that type must contain only child elements (no character data), optionally separated by white space.

Examples


DTD

The root element XXX must contain precisely one element AAA followed by one element BBB. Elements AAA and BBB can contain some text but no other elements:

<!ELEMENT XXX (AAA, BBB)>
<!ELEMENT AAA (#PCDATA)>
<!ELEMENT BBB (#PCDATA)>



Valid documents

A valid document exploring several possibilities:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX>
   <AAA>Start</AAA>
   <BBB>End</BBB>
</XXX>


This document is also valid:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX> <AAA/> <BBB/> </XXX>



Documents with errors

Element BBB is missing:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX> <AAA/> ___ </XXX>


Element BBB must follow element AAA:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX> <BBB/> <AAA/> </XXX>


Root element XXX can contain only one element BBB:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX> <AAA/> <BBB/> <BBB/> </XXX>


Root element XXX must not contain any text.:

<!DOCTYPE XXX SYSTEM "tutorial.dtd">
<XXX> Elements: <AAA/> <BBB/> </XXX>