| java.lang.Object org.cyberneko.html.filters.DefaultFilter sample.Script
Script | public class Script extends DefaultFilter (Code) | | This sample demonstrates how to use of the pushInputSource
method of the HTMLConfiguration in order to dynamically insert content
into the HTML stream. The typical use for this functionality is to
insert the result of an embedded script into the HTML document in place
of the script.
This particular example defines a new script language called "NekoHTML"
script that is a tiny subset of the NSGMLS format. The following table
enumerates the NSGMLS features supported by this script language:
(name | A start element with the specified name.
|
---|
"text | Character content with the specified text.
|
---|
)name | An end element with the specified name.
|
---|
In this format, every command is specified on a line by itself.
For example, the following document:
<script type='NekoHTML'>
(h1
"Header
)h1
</script>
is equivalent to the following HTML document:
<H1>Header</H1>
as seen by document handler registered with the parser, when processed
by this filter.
author: Andy Clark version: $Id: Script.java,v 1.3 2004/02/19 20:00:17 andyc Exp $ |
Constructor Summary | |
public | Script(HTMLConfiguration config) Constructs a script object with the specified configuration. |
Method Summary | |
public void | characters(XMLString text, Augmentations augs) Characters. | public void | emptyElement(QName element, XMLAttributes attrs, Augmentations augs) Empty element. | public void | endElement(QName element, Augmentations augs) End element. | public static void | main(String[] argv) Main. | public void | startDocument(XMLLocator locator, String encoding, Augmentations augs) Start document. | public void | startElement(QName element, XMLAttributes attrs, Augmentations augs) Start element. |
AUGMENTATIONS | final protected static String AUGMENTATIONS(Code) | | Augmentations feature identifier.
|
FILTERS | final protected static String FILTERS(Code) | | Filters property identifier.
|
SCRIPT_TYPE | final protected static String SCRIPT_TYPE(Code) | | Script type ("text/x-nekoscript").
|
fScriptCount | protected int fScriptCount(Code) | | The script count.
|
fSystemId | protected String fSystemId(Code) | | The system identifier of the source document.
|
characters | public void characters(XMLString text, Augmentations augs) throws XNIException(Code) | | Characters.
|
emptyElement | public void emptyElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException(Code) | | Empty element.
|
endElement | public void endElement(QName element, Augmentations augs) throws XNIException(Code) | | End element.
|
startDocument | public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code) | | Start document.
|
startElement | public void startElement(QName element, XMLAttributes attrs, Augmentations augs) throws XNIException(Code) | | Start element.
|
Fields inherited from org.cyberneko.html.filters.DefaultFilter | protected XMLDocumentHandler fDocumentHandler(Code)(Java Doc) protected XMLDocumentSource fDocumentSource(Code)(Java Doc)
|
Methods inherited from org.cyberneko.html.filters.DefaultFilter | public void characters(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) public void comment(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) public void doctypeDecl(String root, String publicId, String systemId, Augmentations augs) throws XNIException(Code)(Java Doc) public void emptyElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc) public void endCDATA(Augmentations augs) throws XNIException(Code)(Java Doc) public void endDocument(Augmentations augs) throws XNIException(Code)(Java Doc) public void endElement(QName element, Augmentations augs) throws XNIException(Code)(Java Doc) public void endGeneralEntity(String name, Augmentations augs) throws XNIException(Code)(Java Doc) public void endPrefixMapping(String prefix, Augmentations augs) throws XNIException(Code)(Java Doc) public XMLDocumentHandler getDocumentHandler()(Code)(Java Doc) public XMLDocumentSource getDocumentSource()(Code)(Java Doc) public Boolean getFeatureDefault(String featureId)(Code)(Java Doc) public Object getPropertyDefault(String propertyId)(Code)(Java Doc) public String[] getRecognizedFeatures()(Code)(Java Doc) public String[] getRecognizedProperties()(Code)(Java Doc) public void ignorableWhitespace(XMLString text, Augmentations augs) throws XNIException(Code)(Java Doc) protected static String[] merge(String[] array1, String[] array2)(Code)(Java Doc) public void processingInstruction(String target, XMLString data, Augmentations augs) throws XNIException(Code)(Java Doc) public void reset(XMLComponentManager componentManager) throws XMLConfigurationException(Code)(Java Doc) public void setDocumentHandler(XMLDocumentHandler handler)(Code)(Java Doc) public void setDocumentSource(XMLDocumentSource source)(Code)(Java Doc) public void setFeature(String featureId, boolean state) throws XMLConfigurationException(Code)(Java Doc) public void setProperty(String propertyId, Object value) throws XMLConfigurationException(Code)(Java Doc) public void startCDATA(Augmentations augs) throws XNIException(Code)(Java Doc) public void startDocument(XMLLocator locator, String encoding, NamespaceContext nscontext, Augmentations augs) throws XNIException(Code)(Java Doc) public void startDocument(XMLLocator locator, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void startElement(QName element, XMLAttributes attributes, Augmentations augs) throws XNIException(Code)(Java Doc) public void startGeneralEntity(String name, XMLResourceIdentifier id, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void startPrefixMapping(String prefix, String uri, Augmentations augs) throws XNIException(Code)(Java Doc) public void textDecl(String version, String encoding, Augmentations augs) throws XNIException(Code)(Java Doc) public void xmlDecl(String version, String encoding, String standalone, Augmentations augs) throws XNIException(Code)(Java Doc)
|
|
|