distinguish. Note: Setting URL is not said that this logo really wants to read it, just as a distinguished mark.
HTML in the following example cannot be HTML or HTML XML Version = "1.0" Encoding = "GB2312"?> XML-Stylesheet Type = "TEXT / CSS"?> name html : TD> html: tr> Name html: TD> html: TD> html: tr> name html: TD> html: TD> html: tr> Html: center> html: tr> html: form> html: Table> book> books> six.entity syntax Entity translated into" Entity ". It effects similar to "macro" in Word, you can also understand the touchpad in DW, you can predefine an Entity, then call multiple times in one document, or call the same entity in multiple documents. Entity can include characters, text, and so on, using Entity is the benefits of: 1. It can reduce errors, multiple identical parts in the document only need to enter it over again. 2. It improves maintenance efficiency. For example, you have 40 documents that contain Copyright's Entity, if you need to modify this Copyright, you don't need all files to modify, just change the Entity statement initially defined. XML defines two types of Entity. One is the ordinary Entity we say here, is used in the XML document; the other is the parameter Entity, used in the DTD file.
Entity definition syntax is: For example, I want to define a copyright information: If my copyright information content and others share an XML file, I can also use external calls, syntax like this: ]> Define the reference syntax in the document: & entity-name; for example, copyright information defined above, Writing when calling: & copyright; Complete example, you can copy down to Copyright.xml Watching example: XML Version = "1.0" encoding = "GB2312"?> ]> xml title > ajie author> ajie@aolhoo.com email> 20010115 date> & copyright; myfile> seven.dtd grammar
DTD is a must file with the "Effective XML Document", we define the rules and interrelationships of elements and identities in the document through the DTD file. How to build a DTD file? Let us learn together:
Set element
The element is the basic component of the XML document. You have to define an element in the DTD and then use it in the XML document. The definition of the element is:
Description:
"
Declare "description", is the name of the element;
"(#Pcdata, definition) *>" is the usage rule of this element. Rules define the contents and mutual relationships that the elements can be included. The following table summary lists the rules of the elements:
2. Elemental rule table:
Symbol Meaning Example #pcdata Contains Character or Text Data Element MyFile Contains a text data #pcdata, element-name contains text and other child elements MyFile element must contain text and Tosis child elements, use commas Separate MyFile Elements must be included in order | Use "|" or MyFile Element Title or Author or Email child must be included. Name can only use the MyFile element must contain the title child element, and can only be used once. Name? Use the MyFile element must contain the title child element, and can only be used once; can contain or do not include Author and Email child elements, but if used, only once. Name Use at least once or multiple MyFile elements can contain one, multiple or not containing the title child element () set group, can nescen Element MyFile contains one or more text or title child elements. MyFile element must contain some content, content or a comment; or multiple groups, groups contain: one, multiple or no title chub elements Then it is one or there is no Author child element, and then it is a necessary Email sub-element.
In addition, we can also define attributes for the element, because we do not recommend the use of properties, which is not detailed here. Finally, let's summarize some of the previous four chapters, write a simple instance containing DTD, XML, and Script, which is easy to understand: 1. Put the following files as MyFile.dtd 2. Then build XML document myfile.xml: Xml version = "1.0" encoding = "gb2312"> XML Easy Learning Manual Title> Ajie Author> myfile> 3. Establishing HTML Document MyFile.html