• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DTD Doubt

 
Kiran Reddy Challa
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello..guys..
this was written in the skonnard tutorial regarding the parameter entities.
page: 26
"Parameter entities may not be referenced within other declarations in the internal subset but they may be used in place of a complete declaration."

but this sample program works differently

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE profiles
[
<!ENTITY % rep "(#PCDATA)">
<!ENTITY % list "name,dob,state,country">
<!ENTITY % fulldecl "<!ELEMENT state %rep;>" >
<!ELEMENT profiles (person)+>
<!ELEMENT person (%list >
<!ELEMENT name %rep;> <!-- here iam referring in an internal subset inside other declaration -->
<!ELEMENT dob %rep;>
<!ELEMENT country %rep;>
%fulldecl;
]>
<profiles>
<person>
<name>babu</name>
<dob>05-09-1989</dob>
<state>AP</state>
<country>india</country>
</person>
</profiles>
please reply soon..thanks inadvance
bye,kiran
 
Anonymous
Ranch Hand
Posts: 18944
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes, what skonnard book says is true...ur %rep; and %list; usage in the XML file is incorrect and a validating parser should throw an error...
only %fulldecl; usage is valid.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic