CHAPTER 3 VALIDATION The value of the schemaLocation attribute on the two xsd:include elements in Listing 3-34 is the URI for the schema to be included. The first element includes course.xsd and refers to the code in Listing 3-32. The second include pulls the schema from the instructor.xsd file, which refers to the code in Listing 3-33. Using includeelements, your main schema may pull declarations and definitions from remote files, just as if those files were part of your main schema. You can see examples of using the remote files through the element declarations within the xsd:sequence elements. The element is referring to, through use of the ref attribute, declarations from both the included schemas. You may also notice the additional title element declaration in Listing 3-33. This element is declared in the global scope but is not used even though the course element declaration uses a title element. The title element declared within the course element is in local scope and thus takes precedence over a global scoped declaration. The title declaration in global scope was just a demonstration to show that including schemas does not change the scoping rules of declarations and definitions. Note XML Schema includes are used when all schemas do not use namespaces or are all in the same single namespace. To use schemas in different namespaces, you must use the import element.
Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost PHP Web Hosting services
No comments yet.
Sorry, the comment form is closed at this time.