|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xml.sax.helpers.XMLFilterImpl
org.wikimodel.wem.xhtml.filter.DefaultXMLFilter
org.wikimodel.wem.xhtml.filter.XHTMLWhitespaceXMLFilter
public class XHTMLWhitespaceXMLFilter
Removes non-semantic whitespaces in XML elements. See http://www.w3.org/TR/html4/struct/text.html#h-9.1 for more details. Possible use cases:
text(sp)(sp)text becomes
text(sp)text
| Field Summary |
|---|
| Fields inherited from class org.wikimodel.wem.xhtml.filter.DefaultXMLFilter |
|---|
SAX_LEXICAL_HANDLER_PROPERTY |
| Constructor Summary | |
|---|---|
XHTMLWhitespaceXMLFilter()
|
|
XHTMLWhitespaceXMLFilter(org.xml.sax.XMLReader reader)
|
|
| Method Summary | |
|---|---|
protected void |
appendInlineEvent(org.wikimodel.wem.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
Append an inline element. |
void |
characters(char[] ch,
int start,
int length)
|
protected void |
cleanContentExtraWhiteSpaces()
UC3: Replace group of white spaces by a single space. |
void |
comment(char[] ch,
int start,
int length)
|
void |
endCDATA()
|
void |
endDocument()
|
void |
endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
|
protected void |
endEmptyVisibleElement()
|
protected void |
endNonVisibleElement()
Flush previous content and print current one. |
protected void |
flushContent()
Flush previous content and print current one. |
protected java.lang.StringBuffer |
getContent()
|
protected boolean |
isSemanticComment(java.lang.String comment)
We remove spaces around non semantic comments. |
protected void |
sendCharacters(char[] ch)
|
protected void |
sendCharacters(char[] ch,
int start,
int length)
|
protected void |
sendInlineEvent(org.wikimodel.wem.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
|
protected void |
sendPreviousContent(boolean trimTrailing)
|
protected boolean |
shouldRemoveWhiteSpaces()
|
void |
startCDATA()
|
void |
startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
|
protected void |
startEmptyVisibleElement()
|
protected void |
startNonVisibleElement()
Append an non visible element. |
protected void |
trimLeadingWhiteSpaces()
|
protected java.lang.String |
trimLeadingWhiteSpaces(java.lang.CharSequence content)
|
protected void |
trimTrailingWhiteSpaces()
|
protected java.lang.String |
trimTrailingWhiteSpaces(java.lang.CharSequence content)
|
| Methods inherited from class org.wikimodel.wem.xhtml.filter.DefaultXMLFilter |
|---|
endDTD, endEntity, getProperty, parse, setProperty, startDTD, startEntity |
| Methods inherited from class org.xml.sax.helpers.XMLFilterImpl |
|---|
endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, ignorableWhitespace, notationDecl, parse, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public XHTMLWhitespaceXMLFilter()
public XHTMLWhitespaceXMLFilter(org.xml.sax.XMLReader reader)
| Method Detail |
|---|
public void characters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
characters in interface org.xml.sax.ContentHandlercharacters in class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXException
public void startElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName,
org.xml.sax.Attributes atts)
throws org.xml.sax.SAXException
startElement in interface org.xml.sax.ContentHandlerstartElement in class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXException
public void endElement(java.lang.String uri,
java.lang.String localName,
java.lang.String qName)
throws org.xml.sax.SAXException
endElement in interface org.xml.sax.ContentHandlerendElement in class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXException
public void startCDATA()
throws org.xml.sax.SAXException
startCDATA in interface org.xml.sax.ext.LexicalHandlerstartCDATA in class DefaultXMLFilterorg.xml.sax.SAXException
public void endCDATA()
throws org.xml.sax.SAXException
endCDATA in interface org.xml.sax.ext.LexicalHandlerendCDATA in class DefaultXMLFilterorg.xml.sax.SAXException
public void comment(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
comment in interface org.xml.sax.ext.LexicalHandlercomment in class DefaultXMLFilterorg.xml.sax.SAXException
public void endDocument()
throws org.xml.sax.SAXException
endDocument in interface org.xml.sax.ContentHandlerendDocument in class org.xml.sax.helpers.XMLFilterImplorg.xml.sax.SAXExceptionprotected boolean shouldRemoveWhiteSpaces()
protected void sendPreviousContent(boolean trimTrailing)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void sendInlineEvent(org.wikimodel.wem.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void flushContent()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void appendInlineEvent(org.wikimodel.wem.xhtml.filter.XHTMLWhitespaceXMLFilter.Event event)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void startEmptyVisibleElement()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void endEmptyVisibleElement()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void startNonVisibleElement()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void endNonVisibleElement()
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void sendCharacters(char[] ch)
throws org.xml.sax.SAXException
org.xml.sax.SAXException
protected void sendCharacters(char[] ch,
int start,
int length)
throws org.xml.sax.SAXException
org.xml.sax.SAXExceptionprotected void cleanContentExtraWhiteSpaces()
protected void trimLeadingWhiteSpaces()
protected java.lang.String trimLeadingWhiteSpaces(java.lang.CharSequence content)
protected void trimTrailingWhiteSpaces()
protected java.lang.String trimTrailingWhiteSpaces(java.lang.CharSequence content)
protected java.lang.StringBuffer getContent()
protected boolean isSemanticComment(java.lang.String comment)
comment - the comment to evaluate
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||