CHAPTER 3 VALIDATION Global and Local Scope
CHAPTER 3 VALIDATION Global and Local Scope When using a DTD, the root element is declared in the DOCTYPE declaration to specify the starting element of the document. XML Schemas do not have this concept. Schemas have the concept of global and local scope. All definitions and declarations, which are direct child elements of the schemaelement, are in the global scope. Elements in this respect refer to XML elements in general and not to xsd:elements. The rest of the declarations and definitions are local to whichever element contains them. All elements, referring to the xsd:element elements within the schema, declared within the global scope can be used as a root element. Unlike a DTD, XML Schemas have the ability to validate multiple documents since any globally scoped element declaration can be used as the root. The schema in Listing 3-26 contains one element in the global scope. The declaration for the courseselement is the only piece of the schema in the global scope because it is the only child of the xsd:schema element. Listing 3-30 illustrates a modified version of the schema in Listing 3-26. Most of the coursechild element declarations have been omitted for brevity. Listing 3-30. Element Declarations in Global Scope
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Clan Web Hosting services