public class XHTMLWriter extends FixedHTMLWriter
The result will be a valid XML file, but it is not granted that the file will really be XHTML 1.0 transitional conform. The basic purpose of this class is to give an XSL processor access to plain HTML files.
Modifier and Type | Class and Description |
---|---|
static class |
XHTMLWriter.XHTMLFilterWriter
This FilterWriter will convert the output of Swing's HTMLWriter to XHTML
format.
|
Constructor and Description |
---|
XHTMLWriter(java.io.Writer writer,
javax.swing.text.html.HTMLDocument doc)
Create a new XHTMLWriter that will write the entire HTMLDocument.
|
XHTMLWriter(java.io.Writer writer,
javax.swing.text.html.HTMLDocument doc,
int pos,
int len)
Create a new XHTMLWriter that will write a part of a HTMLDocument.
|
Modifier and Type | Method and Description |
---|---|
static void |
html2xhtml(java.io.Reader reader,
java.io.Writer writer)
Read HTML from the Reader, and send XHTML to the writer.
|
static void |
main(java.lang.String[] args)
External call to convert a source HTML file to a target XHTML file.
|
void |
write()
Start the writing process.
|
protected void |
writeLineSeparator() |
protected void |
writeOption(javax.swing.text.html.Option option) |
writeAttributes
closeOutUnwantedEmbeddedTags, comment, emptyTag, endTag, isBlockTag, matchNameAttribute, output, selectContent, startTag, synthesizedElement, text, textAreaContent, writeEmbeddedTags
decrIndent, getCanWrapLines, getCurrentLineLength, getDocument, getElementIterator, getEndOffset, getIndentLevel, getIndentSpace, getLineLength, getLineSeparator, getStartOffset, getText, getWriter, incrIndent, indent, inRange, isLineEmpty, setCanWrapLines, setCurrentLineLength, setIndentSpace, setLineLength, setLineSeparator, write, write, write
public XHTMLWriter(java.io.Writer writer, javax.swing.text.html.HTMLDocument doc)
writer
- Writer to write todoc
- Source documentpublic XHTMLWriter(java.io.Writer writer, javax.swing.text.html.HTMLDocument doc, int pos, int len)
writer
- Writer to write todoc
- Source documentpos
- Starting positionlen
- Lengthpublic void write() throws java.io.IOException, javax.swing.text.BadLocationException
write
in class javax.swing.text.html.HTMLWriter
java.io.IOException
javax.swing.text.BadLocationException
protected void writeOption(javax.swing.text.html.Option option) throws java.io.IOException
writeOption
in class javax.swing.text.html.HTMLWriter
java.io.IOException
protected void writeLineSeparator() throws java.io.IOException
writeLineSeparator
in class javax.swing.text.html.HTMLWriter
java.io.IOException
public static void html2xhtml(java.io.Reader reader, java.io.Writer writer) throws java.io.IOException, javax.swing.text.BadLocationException
reader
- HTML sourcewriter
- XHTML targetjava.io.IOException
javax.swing.text.BadLocationException
public static void main(java.lang.String[] args)
Usage: java XHTMLWriter <source file> <target file>
args
- Shell arguments