Re: Regarding DTD in XML

pa8@buffalo.edu writes:

>  Hi,
>
>       I am having a doubt regarding the XML DTD's. Can i define an
> element in a DTD as follows
>
>            <!ELEMENT node(node?,node?,node?)>
>
> and the node element contains some attributes. I just want to know
> whether my node definition is correct or not.

Not quite -- if you want between 0 and 3 <node>s, you need to say it
somewhat differently, to avoid non-determinism:

  <!ELEMENT node (node,(node,node?)?)?>

To add attributes, just do

  <!ATTLIST node attr1 CDATA #IMPLIED 
                 attr2 . . .>

Please note in future that this list is for W3C XML Schema discussion.

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                      Half-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged spam]

Received on Thursday, 4 December 2003 03:54:41 UTC