Top Description Inners Constructors Methods
uk.ac.ed.ph.snuggletex.utilities

public abstract Class MathMLPostProcessor

extends Object
implements DOMPostProcessor
Class Inheritance
All Implemented Interfaces
uk.ac.ed.ph.snuggletex.DOMPostProcessor
Imports
uk.ac.ed.ph.snuggletex.DOMOutputOptions, .DOMPostProcessor, uk.ac.ed.ph.snuggletex.internal.util.XMLUtilities, org.w3c.dom.Document, .Element, .Node

Convenient base for DOMPostProcessors that might want to do interesting things to MathML islands, leaving everything else unchanged.
Author
David McKain
Version
$Revision$

Nested and Inner Type Summary

Modifier and TypeClass and Description
private class
MathMLPostProcessor.DocumentWalker

This inner class traverses a Document in document order, calling back on the MathMLPostProcessor#handleMathMLIsland(Element, Document, Node, int) for each MathML math element discovered.

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected abstract void
handleMathMLIsland(final Element
MathML math element discovered
inputMathIsland
,
Document
resulting Document being built up
outputDocument
,
Node
parent Node in the resulting Document that would own this MathML element if left unchanged.
outputParentNode
,
int
counter for this MathML element, starting at 0 for the first element in document order, 1 for the second, etc.
mathmlCounter
)

This method is called for each MathML math element discovered, in document order.

public final Document
postProcessDOM(Document workDocument, final DOMOutputOptions options, StylesheetManager stylesheetManager)

Implements uk.ac.ed.ph.snuggletex.DOMPostProcessor.postProcessDOM.

Implement this to post-process the raw DOM produced by SnuggleTeX.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

MathMLPostProcessorback to summary
public MathMLPostProcessor()

Method Detail

handleMathMLIslandback to summary
protected abstract void handleMathMLIsland(final Element inputMathIsland, Document outputDocument, Node outputParentNode, int mathmlCounter)

This method is called for each MathML math element discovered, in document order.

Parameters
inputMathIsland:Element

MathML math element discovered

outputDocument:Document

resulting Document being built up

outputParentNode:Node

parent Node in the resulting Document that would own this MathML element if left unchanged.

mathmlCounter:int

counter for this MathML element, starting at 0 for the first element in document order, 1 for the second, etc.

postProcessDOMback to summary
public final Document postProcessDOM(Document workDocument, final DOMOutputOptions options, StylesheetManager stylesheetManager)

Implements uk.ac.ed.ph.snuggletex.DOMPostProcessor.postProcessDOM.

Doc from uk.ac.ed.ph.snuggletex.DOMPostProcessor.postProcessDOM.

Implement this to post-process the raw DOM produced by SnuggleTeX.

You will be given an entire DOM Document to analyse, containing a root element called root in the SnuggleConstants#SNUGGLETEX_NAMESPACE namespace.

You should create a new Document and return it. The children of the root element will end up being the Nodes added to the final DOM.

You MUST NOT modify the workDocument that is passed to you.

uk.ac.ed.ph.snuggletex.utilities back to summary

private Class MathMLPostProcessor.DocumentWalker

extends Object
Class Inheritance
  • java.lang.Object
  • uk.ac.ed.ph.snuggletex.utilities.MathMLPostProcessor.DocumentWalker

This inner class traverses a Document in document order, calling back on the MathMLPostProcessor#handleMathMLIsland(Element, Document, Node, int) for each MathML math element discovered.

Field Summary

Modifier and TypeField and Description
private final Document
private Node
private int
private final Document
private Node

Constructor Summary

AccessConstructor and Description
public
DocumentWalker(final Document inputDocument, final Document outputDocument)

Method Summary

Modifier and TypeMethod and Description
public void
run()

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

inputDocumentback to summary
private final Document inputDocument
inputNodeback to summary
private Node inputNode
mathmlCounterback to summary
private int mathmlCounter
outputDocumentback to summary
private final Document outputDocument
outputParentNodeback to summary
private Node outputParentNode

Constructor Detail

DocumentWalkerback to summary
public DocumentWalker(final Document inputDocument, final Document outputDocument)

Method Detail

runback to summary
public void run()