File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes XML and Related Technologies and the fly likes DTD - parameter entity Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "DTD - parameter entity" Watch "DTD - parameter entity" New topic

DTD - parameter entity

v ho

Joined: Apr 05, 2011
Posts: 1
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

Joined: Jan 18, 2011
Posts: 463
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.
I agree. Here's the link:
subject: DTD - parameter entity
Similar Threads
DTD...declaring an element which has child elements and PCDATA
Calling a method from within a method in another class (in the same package)?
Address Book Java Issues
User-defined objects in collections
Hibernate example error message