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| 构造器和说明 |
|---|
XMLStringOutputOptions() |
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
getDoctypePublic()
Gets the public identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_PUBLIC. |
java.lang.String |
getDoctypeSystem()
Gets the system identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_SYSTEM. |
java.lang.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(java.lang.String doctypePublic)
Sets the public identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_PUBLIC. |
void |
setDoctypeSystem(java.lang.String doctypeSystem)
Sets the system identifier to use in the resulting DOCTYPE declaration,
as described in
OutputKeys.DOCTYPE_SYSTEM. |
void |
setEncoding(java.lang.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 在接口中 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 在接口中 SerializationSpecifierserializationMethod - SerializationMethod to use, which must not be null.public java.lang.String getEncoding()
Default is SerializationSpecifier.DEFAULT_ENCODING.
getEncoding 在接口中 SerializationSpecifierpublic void setEncoding(java.lang.String encoding)
Must not be null.
setEncoding 在接口中 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 在接口中 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 在接口中 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 在接口中 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 在接口中 SerializationSpecifierpublic boolean isIncludingXMLDeclaration()
public void setIncludingXMLDeclaration(boolean includingXMLDeclaration)
setIncludingXMLDeclaration 在接口中 SerializationSpecifierincludingXMLDeclaration - true to include an XML declaration, false otherwise.public boolean isUsingNamedEntities()
Default is false.
isUsingNamedEntities 在接口中 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 在接口中 SerializationSpecifierusingNamedEntities - true to use named entities, false to default to using
numeric character references.public java.lang.String getDoctypePublic()
OutputKeys.DOCTYPE_PUBLIC.
Default is null
getDoctypePublic 在接口中 SerializationSpecifierpublic void setDoctypePublic(java.lang.String doctypePublic)
OutputKeys.DOCTYPE_PUBLIC.setDoctypePublic 在接口中 SerializationSpecifierdoctypePublic - public identifier to use, null for no identifier.public java.lang.String getDoctypeSystem()
OutputKeys.DOCTYPE_SYSTEM.
Default is null
getDoctypeSystem 在接口中 SerializationSpecifierpublic void setDoctypeSystem(java.lang.String doctypeSystem)
OutputKeys.DOCTYPE_SYSTEM.setDoctypeSystem 在接口中 SerializationSpecifierdoctypeSystem - system identifier to use, null for no identifier.