-1

Can root element have text in it?

For example if the DTD is:

<?xml version=”1.0” standalone=”yes” ?>
<!DOCTYPE items [
 <!ELEMENT items (item*) >
 <!ELEMENT item (article,country,price)+ >
]> 

can the XML document be <items>hello</items> ?

1 Answers1

2

Text is #PCDATA, the DTD does not say you can include #PCDATA there, so no.

Quentin
  • 914,110
  • 126
  • 1,211
  • 1,335