public interface SerializationSpecifier
The main implementation of this is XMLStringOutputOptions, which you can use
for normal SnuggleTeX functionality. There is also a SerializationOptions
implementation that can be used for various utility classes, such as MathMLUtilities.
XMLStringOutputOptions,
SerializationOptions| 限定符和类型 | 字段和说明 |
|---|---|
static java.lang.String |
DEFAULT_ENCODING
Default encoding to use
|
static int |
DEFAULT_INDENT
Default indent to use when
isIndenting() returns true |
| 限定符和类型 | 方法和说明 |
|---|---|
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.
|
static final java.lang.String DEFAULT_ENCODING
static final int DEFAULT_INDENT
isIndenting() returns trueSerializationMethod 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
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
serializationMethod - SerializationMethod to use, which must not be null.java.lang.String getEncoding()
Default is DEFAULT_ENCODING.
void setEncoding(java.lang.String encoding)
Must not be null.
encoding - encoding to use, which must be non-null and recognised by the XSLT
TransformerFactory that will end up doing the serialization.boolean isIndenting()
Default is false.
void setIndenting(boolean indenting)
indenting - true to indent, false otherwise.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.
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.
boolean isIncludingXMLDeclaration()
void setIncludingXMLDeclaration(boolean includingXMLDeclaration)
includingXMLDeclaration - true to include an XML declaration, false otherwise.boolean isUsingNamedEntities()
Default is false.
void setUsingNamedEntities(boolean usingNamedEntities)
Note that this requires an XSLT 2.0-compliant engine (e.g. Saxon, which is in the "full" SnuggleTeX distribution.)
(Also note that the resulting XML won't be parseable unless accompanied with a DTD defining the MathML entities!)
usingNamedEntities - true to use named entities, false to default to using
numeric character references.java.lang.String getDoctypePublic()
OutputKeys.DOCTYPE_PUBLIC.
Default is null
void setDoctypePublic(java.lang.String doctypePublic)
OutputKeys.DOCTYPE_PUBLIC.doctypePublic - public identifier to use, null for no identifier.java.lang.String getDoctypeSystem()
OutputKeys.DOCTYPE_SYSTEM.
Default is null
void setDoctypeSystem(java.lang.String doctypeSystem)
OutputKeys.DOCTYPE_SYSTEM.doctypeSystem - system identifier to use, null for no identifier.