TAILIEUCHUNG - XML Step by Step- P10
Tham khảo tài liệu 'xml step by step- p10', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | 158 XML Step by Step -- external entities containing reviews -- -- to be assigned to Review attribute of BOOK elements -- NOTATION DOC SYSTEM Microsoft Word document NOTATION TXT SYSTEM plain text file ENTITY rev_leaves SYSTEM Review of Leaves of NDATA DOC ENTITY rev_faun1 SYSTEM Review 01 of The Marble NDATA DOC ENTITY rev_faun2 SYSTEM Review 02 of The Marble NDATA TXT ENTITY rev_screw SYSTEM Review of The Turn of the NDATA TXT The first three entities are general internal parsed entities that you can insert in BINDING elements rather than typing the actual binding description into each element. Using entities can help ensure that your descriptions of a given binding type are consistent from book to book. Also entities make it easier to modify a description. For example you could change hardcover to hardback in every BINDING element where it occurs by simply editing the hard entity. The next and final four entities are general external unparsed entities that allow you to attach external files containing book reviews to BOOK elements. 3 Add the Reviews attribute to the attribute-list declaration for the BOOK element later in the DTD so that it reads like this ATTLIST BOOK InStock yes no REQUIRED Reviews ENTITIES IMPLIED Reviews is an optional attribute IMPLIED to which you can assign the names of one or more general external unparsed entities Reviews has the ENTITIES type . 4 In each BINDING element replace the binding description with the corresponding entity reference. For example you would change the BINDING element for The Adventures of Huckleberry Finn from BINDING mass market paperback BINDING to BINDING mass BINDING 5 Add Reviews attributes to BOOK elements as follows For Leaves of Grass BOOK InStock no Reviews rev_leaves Chapter 6 Defining and Using Entities 159 The standalone Document Declaration As you learned near the beginning of Chapter 3 you can optionally include a standalone document declaration in the XML .
đang nạp các trang xem trước