This is the DTD
<!-- Root element article should contain the elements in parenthesis in that order. -->
<!ELEMENT article (headline,description,authorid,pubdate,status,keywords,body)>
<!-- CDATA stands for Character Data, this attribute can contain any string of characters or numbers. -->
<!ATTLIST article
id CDATA #REQUIRED>
<!-- // PCDATA stands for Parsed Character Data. Element must contain only text. -->
<!ELEMENT headline (#PCDATA)>
<!ELEMENT description (#PCDATA)>
<!ELEMENT authorid (#PCDATA)>
<!ELEMENT pubdate (#PCDATA)>
<!ELEMENT status (#PCDATA)>
<!ELEMENT keywords (#PCDATA)>
<!ELEMENT body (#PCDATA)>
This is the XML file:
<?xml version="1.0" standalone="no" ?>
<article>
<headline id="somenumber">
</headline>
<description>This article is to practice creation of a CMS-powered website</description>
<authorid>1</authorid>
<pubdate>2006-11-10</pubdate>
<status>live</status>
<keywords>keywords separated by spaces</keywords>
<body>
<![CDATA[
<h1>this is a heading</h1>
<p>something</p>
]]>
</body>
</article>
According to the book Im reading (No nonsense XML Web Development with PHP in page 62) it says:
the sequence not only specifies the order in which the elements should appear, but also, how many of each element should appear
So, to make sure my DTD was working, I put the elements in the WRONG order but there was NO error message. I tested with IE and FF.
Do DTDs specify the ORDER in which elements should appear?
Thanks in advance,
Leo