This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

DTD - parameter entity

 
v ho
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am having trouble trying to implement parameter entities so that i can repeat text multiple times within the DTD.

example XML code:


The address, street, city, postcode elements both have the same information. How would i reuse these sets of elements multiple times within a DTD document using parameter entity ? i know the key syntax is the % sign, but i can't seem to understand how to code it properly.
 
g tsuji
Ranch Hand
Posts: 669
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is how it would look like, making some assumptions on cardinality and content model.

with the external dtd (specifically using parameter entity):

You cannot use parameter entities inside an internal subset, though.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic