Jump to content

DTD elements order


paetje
 Share

Recommended Posts

I made an DTD now I my problem that my elements must appear in the order that is set in the DTD. I sepparated the elements with the ",". What must I use to let my elements appear in a different order?Here's my DTD:

<!ELEMENT website (titel, pagina) >	<!ELEMENT titel (#PCDATA) >	<!ELEMENT pagina (paginatitel, content, overig)>  <!ELEMENT paginatitel (#PCDATA)>    <!ELEMENT content (alinea*)> 	 <!ELEMENT alinea (#PCDATA, nadruk*, tekstlink*, afbeelding*, lijst*, subalinea*)>    <!ELEMENT nadruk (#PCDATA)>    <!ELEMENT tekstlink (#PCDATA)>    <!ELEMENT afbeelding (#PCDATA)>   	 <!ATTLIST afbeelding src CDATA #REQUIRED>   	 <!ATTLIST afbeelding alt CDATA #REQUIRED>   	 <!ATTLIST afbeelding class CDATA #REQUIRED>    <!ELEMENT lijst (item+, itemlink*)>   	 <!ELEMENT item (#PCDATA)>   	 <!ELEMENT itemlink (#PCDATA)>    <!ELEMENT subalinea (#PCDATA, nadruk*, tekstlink*, afbeelding*, lijst*)>  <!ELEMENT overig (links*, objecten*)> 	  	 <!ELEMENT links (kop, link+)>    <!ELEMENT kop (#PCDATA)>    <!ELEMENT link (#PCDATA)> 	 <!ELEMENT ojecten (objectnaam)>    <!ELEMENT object (#PCDATA)>   	 <!ATTLIST object naam CDATA #REQUIRED>

Link to comment
Share on other sites

Hi Paetje,As far as I know, elements declared in dtd must follow the order. You can refer to W3Schools DTD tutorialIf you want them to appear in any order, why not write XML Schema? You can use the <all> indicator because it specifies by default that the child elements can appear in any order and that each child element must occur once and only once. You can read W3School XSchema tutorial

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...