Parameter Entity Example in a DTD

Suppose you define the invoice parameter entity as an internal entity as follows:

<!ENTITY % customer "name, street, city, state, zipcode">
               

            

The percent sign ( %) after the ENTITY keyword indicates that this is a parameter entity. Later in the DTD, you can reference this parameter entity as follows:

<!ELEMENT invoice (%customer;, item, price, date)>
               

            

When this DTD is processed, it is as if you had specified the following:

<!ELEMENT invoice (name, street, city, state, zipcode, item, price, date)>
               

            

 
Free Stylus Studio XML Training:
W3C Member