public class WebPageOutputOptions extends XMLStringOutputOptions
XMLStringOutputOptions to add in options for configuring how to build a
web page using the relevant methods in SnuggleSession
(e.g. SnuggleSession.buildWebPage(WebPageOutputOptions)).
As of SnuggleTeX 1.3, you will generally want to use the various static methods in
WebPageOutputOptionsBuilder to create instances of this class that you can tweak
slightly.
The older WebPageOutputOptionsTemplates is now deprecated and will be removed in
SnuggleTeX 1.4.
DOMOutputOptions,
XMLStringOutputOptions,
WebPageOutputOptionsBuilder,
WebPageOutputOptionsTemplates| Modifier and Type | Class and Description |
|---|---|
static class |
WebPageOutputOptions.WebPageType
Deprecated.
Use
WebPageOutputOptionsBuilder to generate different types of web pages.
More properties have been added to this class to control some of the finer aspects of this. |
DOMOutputOptions.ErrorOutputOptions| Modifier and Type | Field and Description |
|---|---|
static String |
DEFAULT_CONTENT_TYPE
Default content type
|
static String |
DEFAULT_LANG
Default language
|
DEFAULT_MATHML_PREFIX, DEFAULT_SNUGGLETEX_XML_PREFIX, DEFAULT_XHTML_PREFIXDEFAULT_ENCODING, DEFAULT_INDENT| Constructor and Description |
|---|
WebPageOutputOptions() |
| Modifier and Type | Method and Description |
|---|---|
void |
addClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs)
Appends to existing array of relative URLs specifying client-side XSLT stylesheets to be
referenced in the resulting page.
|
void |
addCSSStylesheetURLs(String... cssStylesheetURLs)
Appends to existing array of relative URLs specifying client-side CSS stylesheets to be
referenced in the resulting page.
|
void |
addStylesheets(Transformer... stylesheets)
Appends to existing array of JAXP
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. |
String[] |
getClientSideXSLTStylesheetURLs()
Returns specified array of relative URLs specifying client-side XSLT stylesheets to be
referenced in the resulting page.
|
String |
getContentType()
Returns the MIME type for the resulting page.
|
String[] |
getCSSStylesheetURLs()
Returns specified array of relative URLs specifying client-side CSS stylesheets to be
referenced in the resulting page.
|
String |
getCustomMathJaxUrl() |
String |
getLang()
Returns the language of the resulting page, null if not set.
|
String |
getMathPrefRenderer()
Gets the value of the optional
pref:renderer attribute
(in the W3CConstants.MATHML_PREF_NAMESPACE)
that can be added to the HTML root element to control certain aspects of the
client-side
Universal StyleSheets for MathML
The default is null, indicating that no attribute will be added |
Transformer[] |
getStylesheets()
Returns an array of specified JAXP
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. |
String |
getTitle()
Returns the title for the resulting page, null if not set.
|
WebPageOutputOptions.WebPageType |
getWebPageType()
Deprecated.
Use various methods in
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak. |
boolean |
isAddingMathPlayerImport()
Returns whether to include the necessary processing instruction and
object
element required to explicitly trigger the MathPlayer plugin. |
boolean |
isAddingTitleHeading()
Returns whether page title should be inserted at the start of the web page
body as an XHTML
h1 element. |
boolean |
isHtml5() |
boolean |
isIncludingStyleElement()
Returns whether to include SnuggleTeX-related CSS as a
style element within the
resulting page. |
boolean |
isMathJax() |
boolean |
isNoCharsetInContentTypeHeader() |
void |
setAddingMathPlayerImport(boolean addingMathPlayerImport)
Sets whether to include the necessary processing instruction and
object
element required to explicitly trigger the MathPlayer plugin. |
void |
setAddingTitleHeading(boolean addingTitleHeading)
Sets whether page title should be inserted at the start of the web page
body as an XHTML
h1 element. |
void |
setClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs)
Sets an array of relative URLs specifying client-side XSLT stylesheets to be
referenced in the resulting page.
|
void |
setContentType(String contentType)
Sets the MIME type for the resulting page.
|
void |
setCSSStylesheetURLs(String... cssStylesheetURLs)
Specifies an array of relative URLs specifying client-side CSS stylesheets to be
referenced in the resulting page.
|
void |
setCustomMathJaxUrl(String mathJaxPath) |
void |
setHtml5(boolean html5) |
void |
setIncludingStyleElement(boolean includingStyleElement)
Sets whether to include SnuggleTeX-related CSS as a
style element within the
resulting page. |
void |
setLang(String lang)
Sets the language of the resulting page.
|
void |
setMathJax(boolean mathJax) |
void |
setMathPrefRenderer(String mathPrefRenderer)
Sets the value of the optional
pref:renderer attribute
(in the W3CConstants.MATHML_PREF_NAMESPACE)
that can be added to the HTML root element to control certain aspects of the
client-side
Universal StyleSheets for MathML
A null value is allowed, which prevents such an attribute being added. |
void |
setNoCharsetInContentTypeHeader(boolean noCharsetInContentTypeHeader) |
void |
setStylesheets(Transformer... stylesheets)
Sets an array of JAXP
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. |
void |
setTitle(String title)
Sets the title for the resulting page.
|
void |
setWebPageType(WebPageOutputOptions.WebPageType webPageType)
Deprecated.
Use various methods in
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak. |
getDoctypePublic, getDoctypeSystem, getEncoding, getIndent, getSerializationMethod, isIncludingXMLDeclaration, isIndenting, isUsingNamedEntities, setDoctypePublic, setDoctypeSystem, setEncoding, setIncludingXMLDeclaration, setIndent, setIndenting, setSerializationMethod, setUsingNamedEntitiesaddDOMPostProcessors, 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 static final String DEFAULT_CONTENT_TYPE
public static final String DEFAULT_LANG
@Deprecated public WebPageOutputOptions.WebPageType getWebPageType()
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak.From SnuggleTeX 1.3.0, this property no longer controls anything.
@Deprecated public void setWebPageType(WebPageOutputOptions.WebPageType webPageType)
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak.From SnuggleTeX 1.3.0, this property no longer controls anything.
public String getContentType()
Defaults to DEFAULT_CONTENT_TYPE.
public void setContentType(String contentType)
contentType - desired contentType, which must not be null.public String getLang()
Defaults to DEFAULT_LANG.
public void setLang(String lang)
lang - desired language, which may be null.public String getTitle()
Default is null.
This is used to generate a title and possible a h1
header if isAddingTitleHeading() returns true.
public void setTitle(String title)
This is used to generate a title and possible a h1
header if isAddingTitleHeading() returns true.
title - title for the required page, which may be null to indicate
that no title should be included.public boolean isAddingTitleHeading()
h1 element.
Default is false.
This has no effect if getTitle() returns null.
public void setAddingTitleHeading(boolean addingTitleHeading)
h1 element.
This has no effect if getTitle() returns null.
addingTitleHeading - true to add a title header if a title has been set, false otherwise.public boolean isAddingMathPlayerImport()
object
element required to explicitly trigger the MathPlayer plugin.public void setAddingMathPlayerImport(boolean addingMathPlayerImport)
object
element required to explicitly trigger the MathPlayer plugin.addingMathPlayerImport - true to add gubbins for importing MathPlayer, false otherwise.public String getMathPrefRenderer()
pref:renderer attribute
(in the W3CConstants.MATHML_PREF_NAMESPACE)
that can be added to the HTML root element to control certain aspects of the
client-side
Universal StyleSheets for MathML
The default is null, indicating that no attribute will be added
public void setMathPrefRenderer(String mathPrefRenderer)
pref:renderer attribute
(in the W3CConstants.MATHML_PREF_NAMESPACE)
that can be added to the HTML root element to control certain aspects of the
client-side
Universal StyleSheets for MathML
A null value is allowed, which prevents such an attribute being added.
public boolean isIncludingStyleElement()
style element within the
resulting page. If you choose not to do this, you probably want to put snuggletex.css
somewhere accessible and pass its location in via setClientSideXSLTStylesheetURLs(String...).
As of SnuggleTeX 1.2.3, this option is ignored if DOMOutputOptions.isInliningCSS() returns true as its
effect is clearly redundant in this case.
Default is true, as that's the simplest way of getting up to speed quickly.
public void setIncludingStyleElement(boolean includingStyleElement)
style element within the
resulting page. If you choose not to do this, you probably want to put snuggletex.css
somewhere accessible and pass its location in via setClientSideXSLTStylesheetURLs(String...).
As of SnuggleTeX 1.2.3, this option is ignored if DOMOutputOptions.isInliningCSS() returns true as its
effect is clearly redundant in this case.
includingStyleElement - set to true to include a style element, false otherwise.public String[] getCSSStylesheetURLs()
Default is null.
The URLs are used as-is; the caller should have ensured they make sense in advance!
The caller can use this to specify the location of snuggletex.css, as well
as any other required stylesheets.
public void setCSSStylesheetURLs(String... cssStylesheetURLs)
The URLs are used as-is; the caller should have ensured they make sense in advance!
The caller can use this to specify the location of snuggletex.css, as well
as any other required stylesheets.
cssStylesheetURLs - array of CSS stylesheet URLs, which may be emptypublic void addCSSStylesheetURLs(String... cssStylesheetURLs)
The URLs are used as-is; the caller should have ensured they make sense in advance!
The caller can use this to specify the location of snuggletex.css, as well
as any other required stylesheets.
cssStylesheetURLs - array of CSS stylesheet URLs to add, which may be emptypublic String[] getClientSideXSLTStylesheetURLs()
Default is null
The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for WebPageOutputOptions.WebPageType.MATHPLAYER_HTML. Also, if nothing is set
here for a WebPageOutputOptions.WebPageType.CLIENT_SIDE_XSLT_STYLESHEET then WebPageOutputOptions.WebPageType.MOZILLA
will be used as a template instead.
public void setClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs)
The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for WebPageOutputOptions.WebPageType.MATHPLAYER_HTML. Also, if nothing is set
here for a WebPageOutputOptions.WebPageType.CLIENT_SIDE_XSLT_STYLESHEET then WebPageOutputOptions.WebPageType.MOZILLA
will be used as a template instead.
clientSideXSLTStylesheetURLs - array of URLs to use, which may be empty.public void addClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs)
The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for WebPageOutputOptions.WebPageType.MATHPLAYER_HTML. Also, if nothing is set
here for a WebPageOutputOptions.WebPageType.CLIENT_SIDE_XSLT_STYLESHEET then WebPageOutputOptions.WebPageType.MOZILLA
will be used as a template instead.
clientSideXSLTStylesheetURLs - array of URLs to append, which may be empty.public Transformer[] getStylesheets()
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. This can be useful if you want to add in headers
and footers to the resulting XHTML web page.
Default is null.
Remember that the XHTML is all in its correct namespace so you will need to write your stylesheet appropriately. Ensure that any further XHTML you generate is also in the correct namespace; it will later be converted to no-namespace HTML if required by the serialisation process.
NOTE: Source documents may contain Processing Instructions (e.g. to invoke MathPlayer) so these must be handled as appropriate.
public void setStylesheets(Transformer... stylesheets)
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. This can be useful if you want to add in headers
and footers to the resulting XHTML web page.
Remember that the XHTML is all in its correct namespace so you will need to write your stylesheet appropriately. Ensure that any further XHTML you generate is also in the correct namespace; it will later be converted to no-namespace HTML if required by the serialisation process.
NOTE: Source documents may contain Processing Instructions (e.g. to invoke MathPlayer) so these must be handled as appropriate.
stylesheets - array of XSLT stylesheets to apply, which may be null. They
are applied in the order specified.public void addStylesheets(Transformer... stylesheets)
Transformers representing XSLT stylesheet(s)
that will be applied to the resulting web page once it has been built but
before it is serialised. This can be useful if you want to add in headers
and footers to the resulting XHTML web page.
Remember that the XHTML is all in its correct namespace so you will need to write your stylesheet appropriately. Ensure that any further XHTML you generate is also in the correct namespace; it will later be converted to no-namespace HTML if required by the serialisation process.
NOTE: Source documents may contain Processing Instructions (e.g. to invoke MathPlayer) so these must be handled as appropriate.
stylesheets - array of additional XSLT stylesheets to apply, which may be null. They
are applied in the order specified.public boolean isHtml5()
public void setHtml5(boolean html5)
public boolean isNoCharsetInContentTypeHeader()
public void setNoCharsetInContentTypeHeader(boolean noCharsetInContentTypeHeader)
public boolean isMathJax()
public void setMathJax(boolean mathJax)
public String getCustomMathJaxUrl()
public void setCustomMathJaxUrl(String mathJaxPath)
Copyright © 2008–2026 The University of Edinburgh. All rights reserved.