The appearance of the problem: XML element name is not fixed, when two different documents describe two different types of elements with the same name, or when a different tag indicates two different meaningful content, it will A naming conflict occurs. Problem Solution: Namespace It is used together, which is equivalent to what is indicated from the element, so it will not confuse the elements of the same name (a bit similar to the role of java in the package, give it a full name). In XML, adopt, unique "domain name" worldwide as Namespace, ie URL, as an XML Namespace. Namespaces allow us to combine different elements and attribute definitions in a document and indicate the definition of these elements and properties from there. The syntax of the namespace is as follows: XMLns: [prefix] = "[URL of Name]" Where "XMLns:" is the necessary properties. "Prefix" is an alias of the namespace, and its value cannot be XML.
INS: BATCH-LIST>
sample> It is worth noting that Batch-List, Batch et al. must be defined in "http://www.lsmx.net.ac", alias INS. Note that you must declare namespace before use, don't forget ":": " 1. Default Namespace XMLns = "[URL of Namespace]" II. Specify the namespace of the parent element, the child element wants to specify the alias of the namespace in the child element with its own namespace. Third, attributes can also have their own namespace.
Front Knowledge Review: The structure of the XML document is a document that meets the XML rule. The legal XML document not only requires the structure, but also requires DTD verification. The DTD is used to specify the syntax structure of the XML document so that the parser can understand the contents of the XML document. The System keyword represents the DTD file is an external file, that is, the parser will look for this DTD file according to the instructions behind System. If the content of an element is declared as EMPTY, it means that the element cannot contain any child elements and text. Any indicates that the element can contain any elements of the effective element, that is, it can include an element that has been declared in other locations of DTD. PCDATA indicates that the element can contain any character data, but it cannot contain any sub-elements therein.