public class XMLStringOutputOptions extends DOMOutputOptions implements SerializationSpecifier
DOMOutputOptions to add in options for configuring how to build an
serialized output consisting of an XML (or possibly HTML) String using the relevant methods
in SnuggleSession
(e.g. SnuggleSession.buildXMLString(XMLStringOutputOptions)).DOMOutputOptions,
WebPageOutputOptions,
WebPageOutputOptionsBuilderDOMOutputOptions.ErrorOutputOptionsDEFAULT_MATHML_PREFIX, DEFAULT_SNUGGLETEX_XML_PREFIX, DEFAULT_XHTML_PREFIXDEFAULT_ENCODING, DEFAULT_INDENT| Constructor and Description |
|---|
XMLStringOutputOptions() |
| Modifier and Type | Method and Description |
|---|---|
String |
getDoctypePublic()
Gets the public identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_PUBLIC. |
String |
getDoctypeSystem()
Gets the system identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_SYSTEM. |
String |
getEncoding()
Gets the encoding for the resulting serialized XML.
|
int |
getIndent()
Returns the indentation level to use when
isIndenting() returns true. |
SerializationMethod |
getSerializationMethod()
Gets the
SerializationMethod to use when generating the final output. |
boolean |
isIncludingXMLDeclaration()
Gets whether to include an XML declaration on the resulting output.
|
boolean |
isIndenting()
Returns whether the resulting XML will be indented or not.
|
boolean |
isUsingNamedEntities()
Returns whether to use named entities for certain MathML symbols rather than
numeric character references.
|
void |
setDoctypePublic(String doctypePublic)
Sets the public identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_PUBLIC. |
void |
setDoctypeSystem(String doctypeSystem)
Sets the system identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_SYSTEM. |
void |
setEncoding(String encoding)
Sets the encoding for the resulting serialized XML.
|
void |
setIncludingXMLDeclaration(boolean includingXMLDeclaration)
Sets whether to include an XML declaration on the resulting output.
|
void |
setIndent(int indent)
Sets the indentation level to use when
isIndenting() returns true. |
void |
setIndenting(boolean indenting)
Sets whether the resulting XML will be indented or not.
|
void |
setSerializationMethod(SerializationMethod serializationMethod)
Sets the
SerializationMethod to use when generating the final output. |
void |
setUsingNamedEntities(boolean usingNamedEntities)
Sets whether to use named entities for certain MathML symbols rather than
numeric character references.
|
addDOMPostProcessors, clone, getDOMPostProcessors, getErrorOutputOptions, getInlineCSSProperties, getLinkResolver, getMathMLPrefix, getSnuggleXMLPrefix, getXHTMLPrefix, isAddingMathAnnotations, isAddingMathSourceAnnotations, isApplyingFirefox3SemanticsWorkaround, isInliningCSS, isMathVariantMapping, isPrefixingMathML, isPrefixingSnuggleXML, isPrefixingXHTML, setAddingMathAnnotations, setAddingMathSourceAnnotations, setApplyingFirefox3SemanticsWorkaround, setDOMPostProcessors, setErrorOutputOptions, setInlineCSSProperties, setInliningCSS, setLinkResolver, setMathMLPrefix, setMathVariantMapping, setPrefixingMathML, setPrefixingSnuggleXML, setPrefixingXHTML, setSnuggleXMLPrefix, setXHTMLPrefixpublic SerializationMethod getSerializationMethod()
SerializationMethod to use when generating the final output.
Default is SerializationMethod.XML.
This must not be null.
Note that SerializationMethod.XHTML is only supported properly if you are using
an XSLT 2.0 processor; otherwise it reverts to SerializationMethod.XML
getSerializationMethod in interface SerializationSpecifierpublic void setSerializationMethod(SerializationMethod serializationMethod)
SerializationMethod to use when generating the final output.
This must not be null.
Note that SerializationMethod.XHTML is only supported properly if you are using
an XSLT 2.0 processor; otherwise it reverts to SerializationMethod.XML
setSerializationMethod in interface SerializationSpecifierserializationMethod - SerializationMethod to use, which must not be null.public String getEncoding()
Default is SerializationSpecifier.DEFAULT_ENCODING.
getEncoding in interface SerializationSpecifierpublic void setEncoding(String encoding)
Must not be null.
setEncoding in interface SerializationSpecifierencoding - encoding to use, which must be non-null and recognised by the XSLT
TransformerFactory that will end up doing the serialization.public boolean isIndenting()
Default is false.
isIndenting in interface SerializationSpecifierpublic void setIndenting(boolean indenting)
NOTE: The old version of Xalan that comes bundled with Java 6 (and below) appears to be
unable to indent output when using setIndenting(boolean)
with SerializationMethod.HTML.
I have not checked this behaviour with Java 7 (or above). I however recommend using Saxon,
or including a newer version of Xalan in the ClassPath.
setIndenting in interface SerializationSpecifierindenting - true to indent, false otherwise.public int getIndent()
isIndenting() returns true.
(This is currently only supported if your underlying XSLT process is either Saxon
or Xalan. This will be the case by if you have chosen to either use Saxon or use
the default processor that ships with your Java platform.)
This must be a non-negative integer.
The default value is SerializationSpecifier.DEFAULT_INDENT.
getIndent in interface SerializationSpecifierpublic void setIndent(int indent)
isIndenting() returns true.
(This is currently only supported if your underlying XSLT process is either Saxon
or Xalan. This will be the case by if you have chosen to either use Saxon or use
the default processor that ships with your Java platform.)
This must be a non-negative integer.
The default value is SerializationSpecifier.DEFAULT_INDENT.
setIndent in interface SerializationSpecifierpublic boolean isIncludingXMLDeclaration()
isIncludingXMLDeclaration in interface SerializationSpecifierpublic void setIncludingXMLDeclaration(boolean includingXMLDeclaration)
setIncludingXMLDeclaration in interface SerializationSpecifierincludingXMLDeclaration - true to include an XML declaration, false otherwise.public boolean isUsingNamedEntities()
Default is false.
isUsingNamedEntities in interface SerializationSpecifierpublic void setUsingNamedEntities(boolean usingNamedEntities)
Note that this requires an XSLT 2.0-compliant engine (e.g. Saxon, which is in the "full" SnuggleTeX distribution). This option will be silently ignored if you are using an XSLT 1.0 engine, such as the one which typically comes bundled with your JDK.
(Also note that the resulting XML won't be parseable unless accompanied with a DTD defining the MathML entities!)
setUsingNamedEntities in interface SerializationSpecifierusingNamedEntities - true to use named entities, false to default to using
numeric character references.public String getDoctypePublic()
OutputKeys.DOCTYPE_PUBLIC.
Default is null
getDoctypePublic in interface SerializationSpecifierpublic void setDoctypePublic(String doctypePublic)
OutputKeys.DOCTYPE_PUBLIC.setDoctypePublic in interface SerializationSpecifierdoctypePublic - public identifier to use, null for no identifier.public String getDoctypeSystem()
OutputKeys.DOCTYPE_SYSTEM.
Default is null
getDoctypeSystem in interface SerializationSpecifierpublic void setDoctypeSystem(String doctypeSystem)
OutputKeys.DOCTYPE_SYSTEM.setDoctypeSystem in interface SerializationSpecifierdoctypeSystem - system identifier to use, null for no identifier.Copyright © 2008–2026 The University of Edinburgh. All rights reserved.