predefined, you don't know how your styles might interact withthem. Remember the example where links ended up being white on white?That's the sort of thing we want to avoid.

Let's explore this in a little more detail. Assume thefollowing:

Since, in this circumstance, the author's styles will outweighthe reader's styles -- that's how it is under CSS1,anyway -- then the new style sheet for this document will be as Wednesday 22nd of October 2014 08:20:36 AM

Book Home

Cascading Style Sheets: The Definitive GuideSearch this book

Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z

Index: Y

There are no index entries for this letter.


Symbols | A | B | C | D | E | F | G | H | I | J | K | L | M | N | O | P | Q | R | S | T | U | V | W | X | Y | Z


Library Navigation Links

Copyright © 2002 O'Reilly & Associates, Inc. All Rights Reserved.

In order to create applications of this category, you might have to define a DTD for your information. Then you have to write classes to import and export information from your XML document(s) (validating using your application's DTD if you have one). You must also write the classes which create the user interface in your application. The user of your application can view and modify information using the GUI (graphical user interface), and they can save (and load) their information to (and from) an XML file (that might use your DTD); in other words, they can save (and load) their information to (and from) an ApplicationML file (where Application is the name of your application). Some examples are AddressBookML, MathML, SVGML, etc.

The classes that import and export information from your ApplicationML file must use the parser and SAX or DOM API in order to import the information. These classes can access this information by using one of the following strategies:

  1. Use DOM to directly manipulate the information stored in the document (which DOM turns into a tree of nodes). This document object is created by the DOM XML parser after it reads in the XML document. This option leads to messy and hard-to-understand code. Also, this works better for document-type data rather than just computer generated data (like data structures and objects used in your code).
  2. Create your own Java object model that imports information from the XML document by using either SAX or DOM. This kind of object model only uses SAX or DOM to initialize itself with the information contained in the XML document(s). Once the parsing and initialization of your object model is completed, DOM or SAX isn't used anymore. You can use your own object model to accessed or modify your information without using SAX or DOM anymore. So you manipulate your information using your own objects, and rely on the SAX or DOM APIs to import the information from your ApplicationML file into memory (as a bunch of Java objects). You can think of this object model as an in-memory instance of the information that came was "serialized" in your XML document(s). Changes made to this object model are made persistent automatically, you have to deal with persistence issues (ie, write code to save your object model to a persistence layer as XML).
  3. Table 6-1. Position Keyword Equivalents

    So if you want an image to appear in the very top center of each paragraph, as in Figure 6-38, you need only declare:

    P {background-image: url(bg23.gif);
    background-repeat: no-repeat;
    background-position: top;}
    Figure 6-38

    Figure 6-38. Putting a single background image at the top of every paragraph

    The applications that you create with Java and XML will rely on the services provided by your Java XML Parser (using DOM or SAX). The information itself might be stored in a variety of persistence engines (object databases, relational databases, file systems, dynamic websites, etc.). The information however that comes out of these persistence storage engines must be converted to XML (if they are not in XML already). Once this is done, you have to be concerned with the material covered in this document. This document outlines the most popular Java XML application categories that are possible in an environment where data is encoded with XML, where web access is ubiquitous and platform independence is a necessity.

    Java Application Layer

    All of the code that you write (in your Java classes) might be considered the Java application layer. Other layers are the XML Parser layer, the XML source (that supplies the XML data that is necessary), and the persistence engine (where the data is actually stored and retrieved by the source).

    Your code (in the Java application layer) has to make use of the DOM or SAX API and the XML parser in order to access the information in XML documents (that come from your source). The source might be responsible for pulling data from different persistence engines (relational or object databases) and even the web (dynamically generated websites that supply only XML data).

    larger than the surrounding text.</P>

    What we have here is a situation where some of the text has afont-size of 12px , while othertext has a size of 24px . However, all of the texthas a line-height of 12px,since line-height is an inherited property. Whathappens is that the difference between font-sizeand line-height is divided in half, and thenapplied to the top and bottom of each element's content-height

    LI {margin-bottom: 20px;}
    UL {margin-bottom: -15px;}
    H1 {margin-top: -18px;}

    The larger of the two negative margins (-18px ) is added to the largest positive margin (20px ), yielding (20px-18px = 2px ). Thus, there are only two pixels between the bottom of the list item's content and the top of the paragraph's content. This is what we see in Figure 8-24.