152 Persistence descriptor Whilst all XML documents must

152 Persistence descriptor Whilst all XML documents must be well formed, they may optionally be valid according to a grammar. The grammar for an XML document is provided through a DTD. This is a text file that defines the valid attribute names for each tag, as well as the valid contents of each tag. Tag content is specified in terms of the allowable tags that may be included, and their respective cardinality. For example, the tag has an attribute called name that is mandatory. Between the opening tag and the closing tag a document may contain zero or more or tags. The DTD specifies this as follows: The asterisk (*) represents a cardinality of zero, one, or many. You will occasionally see the plus sign (+), which is used in DTDs to represent the cardinality of one or many. The DTD for JDO persistence descriptors is a file called jdo.dtd. Every persistence descriptor references the DTD through a DOCTYPE directive. An example is shown below. The actual path to jdo.dtd will vary according to your installation. The full contents of jdo.dtd is shown in Appendix C. Hopefully the brief discussion above will be sufficient for you to read the DTD if you wish to do so. For further information about XML, and the Java APIs available to manipulate XML documents, I recommend Java and XML (McLaughlin, 2000). 10.2 Naming the persistence descriptor A single persistence descriptor document should describe either a single class, or a single package. The descriptor should be named appropriately with either the class name or package name, followed by the extension .jdo. This naming convention is recommended by the specification. However, it is unlikely that enhancement tools will enforce it, particularly since the DTD specifically provides for multiple packages to be described in a single descriptor.
Note: If you are looking for high quality webhost to host and run your jsp application check Vision jsp hosting services

Comments are closed.