Thursday, 28 February 2008

simple DTD file

Following codes are a kind of INTERNAL SUBSET DTD style <


< !DOCTYPE people_list[
< !ELEMENT people_list (person*)>
< !ELEMENT person (name, birthdate?, gender?, socialsecuritynumber?)>
< !ELEMENT name (#PCDATA)>
< !ELEMENT birthdate (#PCDATA)>
< !ELEMENT gender (#PCDATA)>
< !ELEMENT socialsecuritynumber (#PCDATA)>]>



Fred Bloggs
27/11/2008
Male


#############################################


Following codes are a kind of EXTERNAL SUBSET DTD style,which includes 2 separate files.<

1. xml file:


< !DOCTYPE people_list SYSTEM "example.dtd">


Fred Bloggs
27/11/2008
Male




2. dtd file:

< !ELEMENT people_list (person*)>
< !ELEMENT person (name, birthdate?, gender?, socialsecuritynumber?)>
< !ELEMENT name (#PCDATA)>
< !ELEMENT birthdate (#PCDATA)>
< !ELEMENT gender (#PCDATA)>
< !ELEMENT socialsecuritynumber (#PCDATA)>

No comments:

My photo
London, United Kingdom
twitter.com/zhengxin

Facebook & Twitter