public class DOMOutputOptions
extends java.lang.Object
implements java.lang.Cloneable
SnuggleSession (e.g. SnuggleSession.buildDOMSubtree(org.w3c.dom.Element)| 限定符和类型 | 类和说明 |
|---|---|
static class |
DOMOutputOptions.ErrorOutputOptions
Enumerates the various options for representing
InputErrors in the resulting
DOM. |
| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
DEFAULT_MATHML_PREFIX
Default prefix to use if/when prefixing MathML elements
|
static java.lang.String |
DEFAULT_SNUGGLETEX_XML_PREFIX
Default prefix to use if/when prefixing SnuggleTeX XML elements
|
static java.lang.String |
DEFAULT_XHTML_PREFIX
Default prefix to use if/when prefixing XHTML elements
|
| 构造器和说明 |
|---|
DOMOutputOptions() |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addDOMPostProcessors(DOMPostProcessor... domPostProcessors)
Appends to the currently specified
DOMPostProcessor that will be called in
turn to "fix up" or modify the raw DOM produced by SnuggleTeX immediately after it has been built. |
java.lang.Object |
clone() |
DOMPostProcessor[] |
getDOMPostProcessors()
Returns the array of
DOMPostProcessor that will be called in turn to "fix up" or
modify the raw DOM produced by SnuggleTeX immediately after it has been built. |
DOMOutputOptions.ErrorOutputOptions |
getErrorOutputOptions()
Gets the current
DOMOutputOptions.ErrorOutputOptions, specifying how (and whether) error details
should be embedded into the resulting XML. |
java.util.Properties |
getInlineCSSProperties()
Gets the
Properties Object that will be used to determine inline CSS properties,
if used. |
LinkResolver |
getLinkResolver()
Gets the currently specified "link resolver" which can fix up any XHTML links created by
certain LaTeX inputs.
|
java.lang.String |
getMathMLPrefix()
Gets the prefix to use for MathML elements when
isPrefixingMathML() returns true. |
java.lang.String |
getSnuggleXMLPrefix()
Gets the prefix to use for custom SnuggleTeX XML elements when
isPrefixingSnuggleXML()
returns true. |
java.lang.String |
getXHTMLPrefix()
Gets the prefix to use for XHTML elements when
isPrefixingXHTML() returns true. |
boolean |
isAddingMathAnnotations()
已过时。
Use
isAddingMathSourceAnnotations() instead |
boolean |
isAddingMathSourceAnnotations()
Returns whether the MathML
math elements generated by SnuggleTeX should
be annotated with the LaTeX input used to generate them. |
boolean |
isApplyingFirefox3SemanticsWorkaround()
Returns whether we should wrap "display math" MathML content within an additional
<mstyle displaystyle="true">....
|
boolean |
isInliningCSS()
Get whether CSS styling is being inlined via
style attributes or not. |
boolean |
isMathVariantMapping()
Returns whether we should perform automatic mappings of (safe) Unicode characters when applying
"stylings" like
\\mathcal and \\mathbb. |
boolean |
isPrefixingMathML()
Returns whether MathML elements should be prefixed or not.
|
boolean |
isPrefixingSnuggleXML()
Returns whether custom SnuggleTeX XML elements should be prefixed or not.
|
boolean |
isPrefixingXHTML()
Returns whether XHTML elements should be prefixed or not.
|
void |
setAddingMathAnnotations(boolean addingMathSourceAnnotations)
已过时。
Use
setAddingMathSourceAnnotations(boolean) instead |
void |
setAddingMathSourceAnnotations(boolean addingMathSourceAnnotations)
Sets whether the MathML
math elements generated by SnuggleTeX should
be annotated with the LaTeX input used to generate them. |
void |
setApplyingFirefox3SemanticsWorkaround(boolean applyingFirefox3SemanticsWorkaround)
Specifies whether we should wrap "display math" MathML content within an additional
<mstyle displaystyle="true">....
|
void |
setDOMPostProcessors(DOMPostProcessor... domPostProcessors)
Sets the array of
DOMPostProcessor that will be called in turn to "fix up" or
modify the raw DOM produced by SnuggleTeX immediately after it has been built. |
void |
setErrorOutputOptions(DOMOutputOptions.ErrorOutputOptions errorOutputOptions)
Sets the current
DOMOutputOptions.ErrorOutputOptions, specifying how (and whether) error details
should be embedded into the resulting XML. |
void |
setInlineCSSProperties(java.util.Properties inlineCSSProperties)
Sets the
Properties Object that will be used to determine inline CSS properties,
if used. |
void |
setInliningCSS(boolean inliningCSS)
Set whether CSS styling is to be inlined via
style attributes or not. |
void |
setLinkResolver(LinkResolver linkResolver)
Sets the "link resolver" that will be given a chance to fix up any XHTML links created by
certain LaTeX inputs.
|
void |
setMathMLPrefix(java.lang.String mathMLPrefix)
Sets the prefix to use for MathML elements when
isPrefixingMathML() returns true. |
void |
setMathVariantMapping(boolean mathVariantMapping)
Sets whether we should perform automatic mappings of (safe) Unicode characters when applying
"stylings" like
\\mathcal and \\mathbb. |
void |
setPrefixingMathML(boolean prefixingMathML)
Sets whether MathML elements should be prefixed or not.
|
void |
setPrefixingSnuggleXML(boolean prefixingSnuggleXML)
Sets whether custom SnuggleTeX XML elements should be prefixed or not.
|
void |
setPrefixingXHTML(boolean prefixingXHTML)
Sets whether XHTML elements should be prefixed or not.
|
void |
setSnuggleXMLPrefix(java.lang.String snuggleXMLPrefix)
Sets the prefix to use for custom SnuggleTeX XML elements when
isPrefixingSnuggleXML()
returns true. |
void |
setXHTMLPrefix(java.lang.String xhtmlPrefix)
Sets the prefix to use for XHTML elements when
isPrefixingXHTML() returns true. |
public static final java.lang.String DEFAULT_XHTML_PREFIX
public static final java.lang.String DEFAULT_MATHML_PREFIX
public static final java.lang.String DEFAULT_SNUGGLETEX_XML_PREFIX
public DOMOutputOptions.ErrorOutputOptions getErrorOutputOptions()
DOMOutputOptions.ErrorOutputOptions, specifying how (and whether) error details
should be embedded into the resulting XML. The default is DOMOutputOptions.ErrorOutputOptions.NO_OUTPUT.public void setErrorOutputOptions(DOMOutputOptions.ErrorOutputOptions errorOutputOptions)
DOMOutputOptions.ErrorOutputOptions, specifying how (and whether) error details
should be embedded into the resulting XML.errorOutputOptions - new DOMOutputOptions.ErrorOutputOptions, which must not be null.public boolean isInliningCSS()
style attributes or not.
This is useful if your output is going to end up embedded in someone else's page
or in a system where you have no control over stylesheets. The default is false.public void setInliningCSS(boolean inliningCSS)
style attributes or not.
This is useful if your output is going to end up embedded in someone else's page
or in a system where you have no control over stylesheets.inliningCSS - true to inline CSS, false otherwisepublic java.util.Properties getInlineCSSProperties()
Properties Object that will be used to determine inline CSS properties,
if used. If null, the default CSS supplied within SnuggleTeX will be used. Default is null.public void setInlineCSSProperties(java.util.Properties inlineCSSProperties)
Properties Object that will be used to determine inline CSS properties,
if used. If null, the default CSS supplied within SnuggleTeX will be used.inlineCSSProperties - Properties file used to determine inline CSS properties, which
should be null if you want to use the SnuggleTeX defaults.public boolean isPrefixingXHTML()
public void setPrefixingXHTML(boolean prefixingXHTML)
prefixingXHTML - true to prefix XHTML elements, false otherwise.public java.lang.String getXHTMLPrefix()
isPrefixingXHTML() returns true.
Default is DEFAULT_XHTML_PREFIX.public void setXHTMLPrefix(java.lang.String xhtmlPrefix)
isPrefixingXHTML() returns true.xhtmlPrefix - desired prefix, which must be non-null and a valid XML NCName.public boolean isPrefixingMathML()
public void setPrefixingMathML(boolean prefixingMathML)
prefixingMathML - true to prefix MathML elements, false otherwise.public java.lang.String getMathMLPrefix()
isPrefixingMathML() returns true.
Default is DEFAULT_MATHML_PREFIX.public void setMathMLPrefix(java.lang.String mathMLPrefix)
isPrefixingMathML() returns true.mathMLPrefix - desired prefix, which must be non-null and a valid XML NCName.public boolean isPrefixingSnuggleXML()
public void setPrefixingSnuggleXML(boolean prefixingSnuggleXML)
prefixingSnuggleXML - true to prefix custom SnuggleTeX XML elements, false otherwise.public java.lang.String getSnuggleXMLPrefix()
isPrefixingSnuggleXML()
returns true. Default is DEFAULT_SNUGGLETEX_XML_PREFIX.public void setSnuggleXMLPrefix(java.lang.String snuggleXMLPrefix)
isPrefixingSnuggleXML()
returns true.snuggleXMLPrefix - desired prefix, which must be non-null and a valid XML NCName.public boolean isAddingMathSourceAnnotations()
math elements generated by SnuggleTeX should
be annotated with the LaTeX input used to generate them. Default is false.public void setAddingMathSourceAnnotations(boolean addingMathSourceAnnotations)
math elements generated by SnuggleTeX should
be annotated with the LaTeX input used to generate them.addingMathSourceAnnotations - set true to include source annotations, false
otherwise.@Deprecated public boolean isAddingMathAnnotations()
isAddingMathSourceAnnotations() instead@Deprecated public void setAddingMathAnnotations(boolean addingMathSourceAnnotations)
setAddingMathSourceAnnotations(boolean) insteadpublic boolean isApplyingFirefox3SemanticsWorkaround()
isAddingMathSourceAnnotations() returns true.
This is a workaround for Bug 468059
which first seemed to appear in Firefox 3 and MathML within semantics elements to
effectively ignore any display="block" attribute on the enclosing MathML
element.
This property is ignored if isAddingMathSourceAnnotations() returns false.
Use this if having annotations and good rendering in Firefox 3 is important to you.
public void setApplyingFirefox3SemanticsWorkaround(boolean applyingFirefox3SemanticsWorkaround)
isAddingMathSourceAnnotations() returns true.
This is a workaround for Bug 468059
which first seemed to appear in Firefox 3 and MathML within semantics elements to
effectively ignore any display="block" attribute on the enclosing MathML
element.
This property is ignored if isAddingMathSourceAnnotations() returns false.
Use this if having annotations and good rendering in Firefox 3 is important to you.
applyingFirefox3SemanticsWorkaround - true to applying the workaround described above when, false otherwise.public boolean isMathVariantMapping()
\\mathcal and \\mathbb. Doing this can help if you
don't have control over CSS and if clients may not have appropriate fonts installed
as it forces the mapping of certain characters to glyphs that may be available.
(Firefox by default does not change fonts for these cases as it is not clear what font to map to so setting this to true can help with some characters.)
Default is false.
public void setMathVariantMapping(boolean mathVariantMapping)
\\mathcal and \\mathbb. Doing this can help if you
don't have control over CSS and if clients may not have appropriate fonts installed
as it forces the mapping of certain characters to glyphs that may be available.
(Firefox by default does not change fonts for these cases as it is not clear what font to map to so setting this to true can help with some characters.)
mathVariantMapping - set true to perform mappings, false otherwise.public DOMPostProcessor[] getDOMPostProcessors()
DOMPostProcessor that will be called in turn to "fix up" or
modify the raw DOM produced by SnuggleTeX immediately after it has been built.
The default is null, which is treated the same as an empty array here.
One use of this is by registering a DownConvertingPostProcessor, which will
attempt to "down-convert" simple MathML expressions into (X)HTML equivalents.
For example, simple linear expressions and simple sub/superscripts can often be converted
to acceptable XHTML alternatives.
Any expressions deemed too complex to be down-converted are kept as MathML.
The SnuggleTeX Up-Conversion module also includes an "UpConvertingPostProcessor" that may be used here as well.
public void setDOMPostProcessors(DOMPostProcessor... domPostProcessors)
DOMPostProcessor that will be called in turn to "fix up" or
modify the raw DOM produced by SnuggleTeX immediately after it has been built.
One use of this is by registering a DownConvertingPostProcessor, which will
attempt to "down-convert" simple MathML expressions into (X)HTML equivalents.
For example, simple linear expressions and simple sub/superscripts can often be converted
to acceptable XHTML alternatives.
Any expressions deemed too complex to be down-converted are kept as MathML.
The SnuggleTeX Up-Conversion module also includes an "UpConvertingPostProcessor" that may be used here as well.
domPostProcessors - array of DOMPostProcessor to use, which may be empty.DownConvertingPostProcessorpublic void addDOMPostProcessors(DOMPostProcessor... domPostProcessors)
DOMPostProcessor that will be called in
turn to "fix up" or modify the raw DOM produced by SnuggleTeX immediately after it has been built.domPostProcessors - array of DOMPostProcessor to append to currently specified
DOMPostProcessors, which may be empty.DownConvertingPostProcessorpublic LinkResolver getLinkResolver()
public void setLinkResolver(LinkResolver linkResolver)
linkResolver - new LinkResolver to use, which may be null to indicate you
want links left as-is.public java.lang.Object clone()
clone 在类中 java.lang.Object