KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > icl > saxon > output > XHTMLEmitter


1 package com.icl.saxon.output;
2 import com.icl.saxon.*;
3 import org.xml.sax.Attributes JavaDoc;
4 import java.io.*;
5 import java.util.*;
6
7
8 /**
9   * XHTMLEmitter is an Emitter that generates XHTML output.
10   * It is the same as XMLEmitter except that it follows the legacy HTML browser
11   * compatibility rules: for example, generating empty elements such as <BR />, and
12   * using <p></p> for empty paragraphs rather than <p/>
13   */

14   
15 public class XHTMLEmitter extends XMLEmitter
16 {
17     /**
18     * Close an empty element tag.
19     */

20
21     protected String JavaDoc emptyElementTagCloser(int nameCode) {
22         String JavaDoc dname = namePool.getDisplayName(nameCode);
23         if (HTMLEmitter.isEmptyTag(dname)) {
24             return " />";
25         } else {
26             return "></" + dname + ">";
27         }
28     }
29
30 }
31
32 //
33
// The contents of this file are subject to the Mozilla Public License Version 1.0 (the "License");
34
// you may not use this file except in compliance with the License. You may obtain a copy of the
35
// License at http://www.mozilla.org/MPL/
36
//
37
// Software distributed under the License is distributed on an "AS IS" basis,
38
// WITHOUT WARRANTY OF ANY KIND, either express or implied.
39
// See the License for the specific language governing rights and limitations under the License.
40
//
41
// The Original Code is: all this file.
42
//
43
// The Initial Developer of the Original Code is
44
// Michael Kay of International Computers Limited (mhkay@iclway.co.uk).
45
//
46
// Portions created by (your name) are Copyright (C) (your legal entity). All Rights Reserved.
47
//
48
// Contributor(s): none.
49
//
50
Popular Tags