tailieunhanh - Beginning XML with DOM and Ajax From Novice to Professional phần 2
in và bị ràng buộc tại Hoa Kỳ của Mỹ đăng kí nhãn hiệu tên có thể xuất hiện trong cuốn sách này. Thay vì sử dụng một biểu tượng thương hiệu với tất cả sự xuất hiện của một tên đã đăng ký nhãn hiệu, chúng tôi sử dụng tên duy nhất trong một biên tập thời trang và vì lợi ích của | 26 CHAPTER 2 RELATED XML RECOMMENDATIONS Element Type Declarations An element type declaration gives information about an element. The declaration starts with the ELEMENT text and lists the element name and contents. The content can be a data type or other elements listed in the DTD ELEMENT elementName elementContents Empty elements show the word EMPTY ELEMENT elementName EMPTY In the sample DTD the DVD element contains three other elements title format and genre ELEMENT DVD title format genre The order of these elements dictates the order in which they should appear within an XML document instance. Parsed Character Data PCDATA indicates that the element s content is text and that an XML parser should parse this text to resolve character and entity references. The title format and genre declarations define their content type as PCDATA ELEMENT title PCDATA ELEMENT format PCDATA ELEMENT genre PCDATA You can use several modifiers to provide more information about child elements. Table 2-1 summarizes these modifiers. Table 2-1. Symbols Used in Element Declarations Within DTDs Symbol Explanation Specifies the order of child elements. Signifies that an element must appear at least once . one or more times . Allows a choice between a group of elements. Marks content as a group. Specifies that the element is optional and can appear any number of times . zero or more times . Specifies that the element is optional but if it s present it can appear only once . zero or one times . No symbol indicates that an element must appear exactly once. The declaration for the DVD element includes a sign which indicates that the element must appear at least once but can appear more often ELEMENT library DVD CHAPTER 2 RELATED XML RECOMMENDATIONS 27 Attribute List Declarations Attribute declarations which appear after element declarations are a little more complicated. You can indicate that an element has attributes by including an attribute list declaration ATTLIST DVD id CDATA .
đang nạp các trang xem trước