Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Dưới đây là bộ xử lý XML sẽ cung cấp một ứng dụng chỉ với môi trường giá trị cho thuộc tính độ dày. Nếu bạn đã chỉ định thuộc tính này cho các phần tử trong cơ thể của các tài liệu mà bạn có thể sử dụng chỉ có giá trị mặc định, nếu không, nó là một lỗi. | Java and XML An important aspect of defining possible attribute values by an enumeration like this is that an XML editor can help the author of a document by prompting with the list of possible attribute values from the DTD when the element is being created. An attribute that you declare as FIXED must always have the default value. For example ATTLIST circle color red blue green REQUIRED line_thickness medium FIXED Here the XML processor will supply an application only with the value medium for the thickness attribute. If you were to specify this attribute for the circle element in the body of the document you can use only the default value otherwise it is an error. Defining Parameter Entities You will often need to repeat a block of information in different places in a DTD. A parameter entity identifies a block of parsed text by a name that you can use to insert the text at various places within a DTD. Note that parameter entities are for use only within a DTD. You cannot use parameter entity references in the body of a document. You declare general entities in the DTD when you want to repeat text within the document body. The form for a parameter entity is very similar to what you saw for general entities except that a character appears between ENTITY and the entity name separated from both by a space. For example it is quite likely that you would want to repeat the x and y attributes that you defined in the position element in the previous section in other elements. You could define a parameter entity for these attributes and then use that wherever these attributes should appear in an element declaration. Here s the parameter entity declaration ENTITY coordinates x CDATA REQUIRED y CDATA REQUIRED Now you can use the entity name to insert the x and y attribute definitions in an attribute declaration ATTLIST position coordinates A parameter entity declaration must precede its use in a DTD. The substitution string in a parameter entity declaration is parsed and can