Referencing Entities in Documents

Now, you should have a pretty solid understanding of how entities are declared and referenced. However, it helps to see entities used in context, so I want to work through an example of how a binary entity is used. The example we'll use is the movie collection document that you've seen several times throughout this chapter and the previous one. One way to improve this document is to provide a means of specifying a movie poster for each movie in the collection. This can be accomplished easily by using binary entities.

The first step in supporting binary entities in the movie collection document is to declare a poster element with an attribute of type ENTITY. The following is the declaration for this element and ...

Get XML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.