public class SimpleHTMLFragment extends AbstractWingElement
This class represents a simple HTML fragment. It allows for user-supplied HTML to be translated on the fly into DRI.
At the present time it only supports the following tags: h1, h2, h3, h4, h5, p, a, b, i, u, ol, li and img. Each are translated into their DRI equivalents. Note that the "h" tags are translated into a paragraph of rend=heading.
If the linkbreaks flag is set then line breaks are treated as paragraphs. This
allows plain text files to also be included and they will be mapped into DRI as
well.
| Modifier and Type | Class and Description |
|---|---|
static class |
SimpleHTMLFragment.SAXFilter
This is a simple SAX Handler that filters out start and end documents.
|
context| Modifier | Constructor and Description |
|---|---|
protected |
SimpleHTMLFragment(WingContext context,
boolean blankLines,
String fragment)
Construct a fragment object for translating into DRI.
|
| Modifier and Type | Method and Description |
|---|---|
void |
toSAX(ContentHandler contentHandler,
LexicalHandler lexicalHandler,
org.xml.sax.helpers.NamespaceSupport namespaces)
Translate this element into SAX
|
dispose, endElement, endElement, getWingContext, greater, lesser, require, require, requireFalse, requireTrue, restrict, sendCharacters, setWingContext, startElement, startElementprotected SimpleHTMLFragment(WingContext context, boolean blankLines, String fragment) throws WingException
context - (Required) The context this element is contained in, such as
where to route SAX events and what i18n catalogue to use.blankLines - (Required) Determine if blank lines should be treated as
paragraphs delimeters.fragment - (Required) The HTML Fragment to be translated into DRI.WingException - passed through.public void toSAX(ContentHandler contentHandler, LexicalHandler lexicalHandler, org.xml.sax.helpers.NamespaceSupport namespaces) throws SAXException
contentHandler - (Required) The registered contentHandler where SAX events
should be routed too.lexicalHandler - (Required) The registered lexicalHandler where lexical events
(such as CDATA, DTD, etc) should be routed too.namespaces - (Required) SAX Helper class to keep track of namespaces able
to determine the correct prefix for a given namespace URI.SAXException - on I/O error.Copyright © 2016 DuraSpace. All rights reserved.