Previous Section  < Day Day Up >  Next Section



What's the purpose of the DOCTYPE statement in the XML file produced by the PropertyFileCreator application?


That's a reference to a document type definition (DTD), a file that defines the rules XML data must follow to be considered valid in its dialect.

If you load the web page referred to in that statement,, you'll find references to each of the elements and attributes contained in the XML file produced by the Java 2 library's Properties class.

Although Sun provides this DTD, Java's official documentation indicates that it shouldn't be relied upon when evaluating property configuration data. Parsers are supposed to ignore it.


An XML file I want to load in a Java program makes use of indentation. How can I strip this out before reading it?


You don't need to strip out indentation and other whitespace. These characters are insignificant in XML, so the Builder class will ignore them when parsing an XML document.

The nu.xom package includes a Serializer class that can set the indentation for XML data, formatting it uniformly when writing the data to a file.


Why is junk e-mail called spam?


Spam, which today describes a wide variety of undesirable junk messages cluttering the Internet, was named after a famous Monty Python's Flying Circus skit.

In the skit, a restaurant works Spam luncheon meat into each of its menu choices. Dishes include egg and Spam; bacon and Spam; bacon, sausage, and Spam; and lobster thermidor aux crevettes with a mornay sauce garnished with truffle pate' brandy and a fried egg on top of Spam.

As for the food, the Hormel Company chose the name by combining the words "spices" and "ham."

    Previous Section  < Day Day Up >  Next Section