All Packages Class Hierarchy This Package Previous Next Index
Class org.w3c.tidy.Tidy
java.lang.Object
|
+----org.w3c.tidy.Tidy
- public class Tidy
- extends Object
- implements Serializable
HTML parser and pretty printer
(c) 1998, 1999 (W3C) MIT, INRIA, Keio University
See Tidy.java for the copyright notice.
Derived from
HTML Tidy Release 26 Jul 1999
Copyright (c) 1998 World Wide Web Consortium (Massachusetts
Institute of Technology, Institut National de Recherche en
Informatique et en Automatique, Keio University). All Rights
Reserved.
Contributing Author(s):
Dave Raggett
Andy Quick (translation to Java)
The contributing author(s) would like to thank all those who
helped with testing, bug fixes, and patience. This wouldn't
have been possible without all of you.
COPYRIGHT NOTICE:
This software and documentation is provided "as is," and
the copyright holders and contributing author(s) make no
representations or warranties, express or implied, including
but not limited to, warranties of merchantability or fitness
for any particular purpose or that the use of the software or
documentation will not infringe any third party patents,
copyrights, trademarks or other rights.
The copyright holders and contributing author(s) will not be
liable for any direct, indirect, special or consequential damages
arising out of any use of the software or documentation, even if
advised of the possibility of such damage.
Permission is hereby granted to use, copy, modify, and distribute
this source code, or portions hereof, documentation and executables,
for any purpose, without fee, subject to the following restrictions:
- The origin of this source code must not be misrepresented.
- Altered versions must be plainly marked as such and must
not be misrepresented as being the original source.
- This Copyright notice may not be removed or altered from any
source or altered source distribution.
The copyright holders and contributing author(s) specifically
permit, without fee, and encourage the use of this source code
as a component for supporting the Hypertext Markup Language in
commercial products. If you use this source code in a product,
acknowledgment is not required but would be appreciated.
-
Tidy()
-
-
getBreakBeforeBR()
-
-
getBurstSlides()
-
-
getCharEncoding()
-
-
getConfiguration()
-
-
getDocType()
-
-
getDropFontTags()
-
-
getErrfile()
-
-
getErrout()
-
-
getFixBackslash()
-
-
getHideEndTags()
-
-
getIndentAttributes()
-
-
getIndentContent()
-
-
getInputStreamName()
-
-
getLogicalEmphasis()
-
-
getMakeClean()
-
-
getNumEntities()
-
-
getOnlyErrors()
-
-
getQuoteAmpersand()
-
-
getQuoteMarks()
-
-
getQuoteNbsp()
-
-
getRawOut()
-
-
getShowWarnings()
-
-
getSlidestyle()
-
-
getSmartIndent()
-
-
getSpaces()
-
-
getStderr()
-
-
getTabsize()
-
-
getUpperCaseAttrs()
-
-
getUpperCaseTags()
-
-
getWrapAsp()
-
-
getWraplen()
-
-
getWrapScriptlets()
-
-
getWriteback()
-
-
getXHTML()
-
-
getXmlOut()
-
-
getXmlPi()
-
-
getXmlPIs()
-
-
getXmlTags()
-
-
main(String[])
- Command line interface to parser and pretty printer.
-
parse(InputStream, OutputStream)
- Parses InputStream in and returns the root Node.
-
setBreakBeforeBR(boolean)
- BreakBeforeBR - o/p newline before <br> or not?
-
setBurstSlides(boolean)
- BurstSlides - create slides on each h2 element
-
setCharEncoding(int)
- CharEncoding
-
setDocType(String)
- DocType - user specified doctype
omit | auto | strict | loose | fpi
where the fpi is a string similar to
"-//ACME//DTD HTML 3.14159//EN"
Note: for fpi include the double-quotes in the string.
-
setDropFontTags(boolean)
- DropFontTags - discard presentation tags
-
setErrfile(String)
- Errfile - file name to write errors to
-
setErrout(PrintWriter)
-
-
setFixBackslash(boolean)
- FixBackslash - fix URLs by replacing \ with /
-
setHideEndTags(boolean)
- HideEndTags - suppress optional end tags
-
setIndentAttributes(boolean)
- IndentAttributes - newline+indent before each attribute
-
setIndentContent(boolean)
- IndentContent - indent content of appropriate tags
-
setInputStreamName(String)
- InputStreamName - the name of the input stream (printed in the
header information).
-
setLogicalEmphasis(boolean)
- LogicalEmphasis - replace i by em and b by strong
-
setMakeClean(boolean)
- MakeClean - remove presentational clutter
-
setNumEntities(boolean)
- NumEntities - use numeric entities
-
setOnlyErrors(boolean)
- OnlyErrors - if true normal output is suppressed
-
setQuoteAmpersand(boolean)
- QuoteAmpersand - output naked ampersand as &
-
setQuoteMarks(boolean)
- QuoteMarks - output " marks as "
-
setQuoteNbsp(boolean)
- QuoteNbsp - output non-breaking space as entity
-
setRawOut(boolean)
- RawOut - avoid mapping values > 127 to entities
-
setShowWarnings(boolean)
- ShowWarnings - however errors are always shown
-
setSlidestyle(String)
- Slidestyle - style sheet for slides
-
setSmartIndent(boolean)
- SmartIndent - does text/block level content effect indentation
-
setSpaces(int)
- Spaces - default indentation
-
setTabsize(int)
- Tabsize
-
setUpperCaseAttrs(boolean)
- UpperCaseAttrs - output attributes in upper not lower case
-
setUpperCaseTags(boolean)
- UpperCaseTags - output tags in upper not lower case
-
setWrapAsp(boolean)
- WrapAsp - wrap within ASP pseudo elements
-
setWraplen(int)
- Wraplen - default wrap margin
-
setWrapScriptlets(boolean)
- WrapScriptlets - wrap within JavaScript string literals
-
setWriteback(boolean)
- Writeback - if true then output tidied markup
-
setXHTML(boolean)
- XHTML - output extensible HTML
-
setXmlOut(boolean)
- XmlOut - create output as XML
-
setXmlPi(boolean)
- XmlPi - add <?xml?> for XML docs
-
setXmlPIs(boolean)
- XmlPIs - if set to true PIs must end with ?>
-
setXmlTags(boolean)
- XmlTags - treat input as XML
Tidy
public Tidy()
getConfiguration
public Configuration getConfiguration()
getStderr
public PrintWriter getStderr()
getErrout
public PrintWriter getErrout()
setErrout
public void setErrout(PrintWriter errout)
setSpaces
public void setSpaces(int spaces)
- Spaces - default indentation
- See Also:
- spaces
getSpaces
public int getSpaces()
setWraplen
public void setWraplen(int wraplen)
- Wraplen - default wrap margin
- See Also:
- wraplen
getWraplen
public int getWraplen()
setCharEncoding
public void setCharEncoding(int charencoding)
- CharEncoding
- See Also:
- CharEncoding
getCharEncoding
public int getCharEncoding()
setTabsize
public void setTabsize(int tabsize)
- Tabsize
- See Also:
- tabsize
getTabsize
public int getTabsize()
setErrfile
public void setErrfile(String errfile)
- Errfile - file name to write errors to
- See Also:
- errfile
getErrfile
public String getErrfile()
setWriteback
public void setWriteback(boolean writeback)
- Writeback - if true then output tidied markup
- See Also:
- writeback
getWriteback
public boolean getWriteback()
setOnlyErrors
public void setOnlyErrors(boolean OnlyErrors)
- OnlyErrors - if true normal output is suppressed
- See Also:
- OnlyErrors
getOnlyErrors
public boolean getOnlyErrors()
setShowWarnings
public void setShowWarnings(boolean ShowWarnings)
- ShowWarnings - however errors are always shown
- See Also:
- ShowWarnings
getShowWarnings
public boolean getShowWarnings()
setIndentContent
public void setIndentContent(boolean IndentContent)
- IndentContent - indent content of appropriate tags
- See Also:
- IndentContent
getIndentContent
public boolean getIndentContent()
setSmartIndent
public void setSmartIndent(boolean SmartIndent)
- SmartIndent - does text/block level content effect indentation
- See Also:
- SmartIndent
getSmartIndent
public boolean getSmartIndent()
setHideEndTags
public void setHideEndTags(boolean HideEndTags)
- HideEndTags - suppress optional end tags
- See Also:
- HideEndTags
getHideEndTags
public boolean getHideEndTags()
setXmlTags
public void setXmlTags(boolean XmlTags)
- XmlTags - treat input as XML
- See Also:
- XmlTags
getXmlTags
public boolean getXmlTags()
setXmlOut
public void setXmlOut(boolean XmlOut)
- XmlOut - create output as XML
- See Also:
- XmlOut
getXmlOut
public boolean getXmlOut()
setXHTML
public void setXHTML(boolean xHTML)
- XHTML - output extensible HTML
- See Also:
- xHTML
getXHTML
public boolean getXHTML()
setRawOut
public void setRawOut(boolean RawOut)
- RawOut - avoid mapping values > 127 to entities
- See Also:
- RawOut
getRawOut
public boolean getRawOut()
setUpperCaseTags
public void setUpperCaseTags(boolean UpperCaseTags)
- UpperCaseTags - output tags in upper not lower case
- See Also:
- UpperCaseTags
getUpperCaseTags
public boolean getUpperCaseTags()
setUpperCaseAttrs
public void setUpperCaseAttrs(boolean UpperCaseAttrs)
- UpperCaseAttrs - output attributes in upper not lower case
- See Also:
- UpperCaseAttrs
getUpperCaseAttrs
public boolean getUpperCaseAttrs()
setMakeClean
public void setMakeClean(boolean MakeClean)
- MakeClean - remove presentational clutter
- See Also:
- MakeClean
getMakeClean
public boolean getMakeClean()
setBreakBeforeBR
public void setBreakBeforeBR(boolean BreakBeforeBR)
- BreakBeforeBR - o/p newline before <br> or not?
- See Also:
- BreakBeforeBR
getBreakBeforeBR
public boolean getBreakBeforeBR()
setBurstSlides
public void setBurstSlides(boolean BurstSlides)
- BurstSlides - create slides on each h2 element
- See Also:
- BurstSlides
getBurstSlides
public boolean getBurstSlides()
setNumEntities
public void setNumEntities(boolean NumEntities)
- NumEntities - use numeric entities
- See Also:
- NumEntities
getNumEntities
public boolean getNumEntities()
setQuoteMarks
public void setQuoteMarks(boolean QuoteMarks)
- QuoteMarks - output " marks as "
- See Also:
- QuoteMarks
getQuoteMarks
public boolean getQuoteMarks()
setQuoteNbsp
public void setQuoteNbsp(boolean QuoteNbsp)
- QuoteNbsp - output non-breaking space as entity
- See Also:
- QuoteNbsp
getQuoteNbsp
public boolean getQuoteNbsp()
setQuoteAmpersand
public void setQuoteAmpersand(boolean QuoteAmpersand)
- QuoteAmpersand - output naked ampersand as &
- See Also:
- QuoteAmpersand
getQuoteAmpersand
public boolean getQuoteAmpersand()
setWrapScriptlets
public void setWrapScriptlets(boolean WrapScriptlets)
- WrapScriptlets - wrap within JavaScript string literals
- See Also:
- WrapScriptlets
getWrapScriptlets
public boolean getWrapScriptlets()
setSlidestyle
public void setSlidestyle(String slidestyle)
- Slidestyle - style sheet for slides
- See Also:
- slidestyle
getSlidestyle
public String getSlidestyle()
setXmlPi
public void setXmlPi(boolean XmlPi)
- XmlPi - add <?xml?> for XML docs
- See Also:
- XmlPi
getXmlPi
public boolean getXmlPi()
setDropFontTags
public void setDropFontTags(boolean DropFontTags)
- DropFontTags - discard presentation tags
- See Also:
- DropFontTags
getDropFontTags
public boolean getDropFontTags()
setWrapAsp
public void setWrapAsp(boolean WrapAsp)
- WrapAsp - wrap within ASP pseudo elements
- See Also:
- WrapAsp
getWrapAsp
public boolean getWrapAsp()
setFixBackslash
public void setFixBackslash(boolean FixBackslash)
- FixBackslash - fix URLs by replacing \ with /
- See Also:
- FixBackslash
getFixBackslash
public boolean getFixBackslash()
setIndentAttributes
public void setIndentAttributes(boolean IndentAttributes)
- IndentAttributes - newline+indent before each attribute
- See Also:
- IndentAttributes
getIndentAttributes
public boolean getIndentAttributes()
setDocType
public void setDocType(String doctype)
- DocType - user specified doctype
omit | auto | strict | loose | fpi
where the fpi is a string similar to
"-//ACME//DTD HTML 3.14159//EN"
Note: for fpi include the double-quotes in the string.
- See Also:
- docTypeStr, docTypeMode
getDocType
public String getDocType()
setLogicalEmphasis
public void setLogicalEmphasis(boolean LogicalEmphasis)
- LogicalEmphasis - replace i by em and b by strong
- See Also:
- LogicalEmphasis
getLogicalEmphasis
public boolean getLogicalEmphasis()
setXmlPIs
public void setXmlPIs(boolean XmlPIs)
- XmlPIs - if set to true PIs must end with ?>
- See Also:
- XmlPIs
getXmlPIs
public boolean getXmlPIs()
setInputStreamName
public void setInputStreamName(String name)
- InputStreamName - the name of the input stream (printed in the
header information).
getInputStreamName
public String getInputStreamName()
parse
public Node parse(InputStream in,
OutputStream out)
- Parses InputStream in and returns the root Node.
If out is non-null, pretty prints to OutputStream out.
main
public static void main(String argv[])
- Command line interface to parser and pretty printer.
All Packages Class Hierarchy This Package Previous Next Index