Cheap Web Hosting for Developers

PHP, MySQL, Java, Unix Cheap Web Hosting

CHAPTER 3 VALIDATION knows to look in

Filed under: PHP and XML — webmaster @ 20:50

CHAPTER 3 VALIDATION knows to look in the global scope for the declaration. It is also on this element that the minOccurs and maxOccursattributes are relevant because they fall within the local scope of complexTypedefinition for the coursesdeclaration. Documents to be validated using the schema in Listing 3-30 may now have either courses or courseas the root element. The following are a few documents that will validate against the schema: XML Schemas offer much more flexibility than a DTD in this respect. A single schema may possibly be able to replace multiple external subsets. All declarations, not just element declarations, may be declared in global scope and used in this manner. It would be perfectly legal to declare an attribute in global scope and reference the global declaration when attaching an attribute to an element. Contrary to the courses and coursedeclarations, title has been declared in the local scope of the course declaration. It cannot be reused; thus, it would be illegal to have a declaration containing ref=”title”. Scope is also not limited to just declarations. DTDs are also affected by their scope. This is why definitions, such as those created through by using a complexType, can have names. Named definitions live in the global scope so they can be shared throughout the schema. Definitions in a local scope are not shared and thus do not require a name, as the name is pretty much meaningless. Examples you have seen so far containing named complexType definitions are actually defining these in the global scope. The examples have been only small code snippets, so you may not even have been aware of this. So what exactly does a full schema look like when sharing definitions? Listing 3-31 builds on Listing 3-30 to define a complex data type named courseType. Listing 3-31. complexType Defined in Global Scope

Note: If you are looking for good and high quality web space to host and run your application check Lunarwebhost Cheap Web Hosting services

No Comments

No comments yet.

RSS feed for comments on this post. TrackBack URI

Sorry, the comment form is closed at this time.

Powered by Cheap Web Hosting