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 |
|---|---|
| public static enum | WebPageOutputOptions.
Deprecated
Use Enumerates the different web page "types" supported.
WebPageOutputOptionsBuilder to generate different types of web pages.
|
| Modifier and Type | Field and Description | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| private boolean | addingMathPlayerImport
Indicates whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin. | ||||||||
| private boolean | addingTitleHeading
Indicates whether page title should be inserted at the start of the web page body as an XHTML h1 element. | ||||||||
| private String[] | clientSideXSLTStylesheetURLs
Array of relative URLs specifying client-side XSLT stylesheets to be specified in the resulting page. | ||||||||
| private String | contentType
MIME type for the resulting page. | ||||||||
| private String[] | cssStylesheetURLs
Array of relative URLs specifying client-side CSS stylesheets to be specified in the resulting page. | ||||||||
| private String | customMathJaxUrl
Specifies a custom MathJax URL to use when invoking MathJax. | ||||||||
| public static final String | DEFAULT_CONTENT_TYPE
Default content type | ||||||||
| public static final String | DEFAULT_LANG
Default language | ||||||||
| private boolean | html5
Determines whether to generate HTML (or XHTML 5) output, which uses a "charset" meta attribute and a different DOCTYPE declaration. | ||||||||
| private boolean | includingStyleElement
Set to include SnuggleTeX-related CSS as a style element within the resulting page. | ||||||||
| private String | lang
Language code for the resulting page. | ||||||||
| private boolean | mathJax
Determines whether to add the required JavaScript to invoke MathJax to render the resulting web page. | ||||||||
| private String | mathPrefRenderer Value of the optional pref:renderer attribute
(in the private boolean | noCharsetInContentTypeHeader
Determines whether to omit character set details in the Content-Type HTTP header when streaming web pages. private Transformer[] | stylesheets
Optional JAXP private String | title
Title for the resulting page. private WebPageOutputOptions. | webPageType
Deprecated
As of SnuggleTeX 1.3.0, this property no longer controls anything. This will be
removed in SnuggleTeX 1.4
Desired "type" of web page to be constructed.
|
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | addClientSideXSLTStylesheetURLs(String...
array of URLs to append, which may be empty. clientSideXSLTStylesheetURLs)Appends to existing array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. |
| public void | addCSSStylesheetURLs(String...
array of CSS stylesheet URLs to add, which may be empty cssStylesheetURLs)Appends to existing array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. |
| public void | addStylesheets(Transformer...
array of additional XSLT stylesheets to apply, which may be null. They
are applied in the order specified. stylesheets)Appends to existing array of JAXP |
| public String[] | getClientSideXSLTStylesheetURLs()
Returns specified array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. |
| public String | |
| public String[] | getCSSStylesheetURLs()
Returns specified array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. |
| public String | |
| public String | |
| public String | getMathPrefRenderer()
Gets the value of the optional pref:renderer attribute
(in the The default is null, indicating that no attribute will be added |
| public Transformer[] | getStylesheets()
Returns an array of specified JAXP |
| public String | |
| public WebPageOutputOptions. | getWebPageType()
Deprecated
Use various methods in
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak.
Before SnuggleTeX 1.3.0, this returned the desired "type" of web page to be constructed. |
| public boolean | Returns: true if adding MathPlayer import gubbins, false otherwise.Returns whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin. |
| public boolean | isAddingTitleHeading()
Returns whether page title should be inserted at the start of the web page body as an XHTML h1 element. |
| public boolean | |
| public boolean | isIncludingStyleElement()
Returns whether to include SnuggleTeX-related CSS as a style element within the resulting page. |
| public boolean | |
| public boolean | |
| public void | setAddingMathPlayerImport(boolean
true to add gubbins for importing MathPlayer, false otherwise. addingMathPlayerImport)Sets whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin. |
| public void | setAddingTitleHeading(boolean
true to add a title header if a title has been set, false otherwise. addingTitleHeading)Sets whether page title should be inserted at the start of the web page body as an XHTML h1 element. |
| public void | setClientSideXSLTStylesheetURLs(String...
array of URLs to use, which may be empty. clientSideXSLTStylesheetURLs)Sets an array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. |
| public void | setContentType(String
desired contentType, which must not be null. contentType)Sets the MIME type for the resulting page. |
| public void | setCSSStylesheetURLs(String...
array of CSS stylesheet URLs, which may be empty cssStylesheetURLs)Specifies an array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. |
| public void | |
| public void | |
| public void | setIncludingStyleElement(boolean
set to true to include a style element, false otherwise. includingStyleElement)Sets whether to include SnuggleTeX-related CSS as a style element within the resulting page. |
| public void | |
| public void | |
| public void | setMathPrefRenderer(String mathPrefRenderer)
Sets the value of the optional pref:renderer attribute
(in the A null value is allowed, which prevents such an attribute being added. |
| public void | |
| public void | setStylesheets(Transformer...
array of XSLT stylesheets to apply, which may be null. They
are applied in the order specified. stylesheets)Sets an array of JAXP |
| public void | |
| public void | setWebPageType(WebPageOutputOptions.
Deprecated
Use various methods in
WebPageOutputOptionsBuilder to generate
suitable options for various types of pages, which you can then tweak.
Before SnuggleTeX 1.3.0, this returned the desired "type" of web page to be constructed. |
| addingMathPlayerImport | back to summary |
|---|---|
| private boolean addingMathPlayerImport Indicates whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin. The default is false.
| |
| addingTitleHeading | back to summary |
|---|---|
| private boolean addingTitleHeading Indicates whether page title should be inserted at the start of the web page body as an XHTML h1 element. This has no effect if title is null. Default is false. | |
| clientSideXSLTStylesheetURLs | back to summary |
|---|---|
| private String[] clientSideXSLTStylesheetURLs Array of relative URLs specifying client-side XSLT stylesheets to be specified in the resulting page. The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for | |
| contentType | back to summary |
|---|---|
| private String contentType MIME type for the resulting page.
Default is This must not be null. | |
| cssStylesheetURLs | back to summary |
|---|---|
| private String[] cssStylesheetURLs Array of relative URLs specifying client-side CSS stylesheets to be specified in the resulting page. 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. | |
| customMathJaxUrl | back to summary |
|---|---|
| private String customMathJaxUrl Specifies a custom MathJax URL to use when invoking MathJax. Use this if you want to use a local installation of MathJax, or want to specify custom configuration directives. See the MathJax Getting Started documentation for more details.
The default is null, which will use the MathJax CDN with a reasonable default configuration
if
| |
| DEFAULT_CONTENT_TYPE | back to summary |
|---|---|
| public static final String DEFAULT_CONTENT_TYPE Default content type | |
| DEFAULT_LANG | back to summary |
|---|---|
| public static final String DEFAULT_LANG Default language | |
| html5 | back to summary |
|---|---|
| private boolean html5 Determines whether to generate HTML (or XHTML 5) output, which uses a "charset" meta attribute and a different DOCTYPE declaration.
Note that if set to true, then this will override whatever is returned by
The default is false.
| |
| includingStyleElement | back to summary |
|---|---|
| private boolean includingStyleElement Set to include SnuggleTeX-related CSS as a 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 Default is true, as that's the simplest way of getting up to speed quickly. | |
| lang | back to summary |
|---|---|
| private String lang Language code for the resulting page.
Default is This may be set to null | |
| mathJax | back to summary |
|---|---|
| private boolean mathJax Determines whether to add the required JavaScript to invoke MathJax to render the resulting web page. The default is false.
| |
| mathPrefRenderer | back to summary |
|---|---|
| private String mathPrefRenderer Value of the optional pref:renderer attribute
(in the | |
| noCharsetInContentTypeHeader | back to summary |
|---|---|
| private boolean noCharsetInContentTypeHeader Determines whether to omit character set details in the Content-Type HTTP header when streaming web pages. MathPlayer can only handle application/xhtml+xml without a "charset" clause, so this should be used in those cases.
| |
| stylesheets | back to summary |
|---|---|
| private Transformer[] stylesheets Optional JAXP 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. If null or empty, then no stylesheet is applied. | |
| title | back to summary |
|---|---|
| private String title Title for the resulting page. Default is null. If null, then a boilerplate title is added. | |
| webPageType | back to summary |
|---|---|
| private WebPageOutputOptions. Deprecated As of SnuggleTeX 1.3.0, this property no longer controls anything. This will be removed in SnuggleTeX 1.4 Desired "type" of web page to be constructed.
| |
| WebPageOutputOptions | back to summary |
|---|---|
| public WebPageOutputOptions() | |
| addClientSideXSLTStylesheetURLs | back to summary |
|---|---|
| public void addClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs) Appends to existing array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for
| |
| addCSSStylesheetURLs | back to summary |
|---|---|
| public void addCSSStylesheetURLs(String... cssStylesheetURLs) Appends to existing array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. 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.
| |
| addStylesheets | back to summary |
|---|---|
| public void addStylesheets(Transformer... stylesheets) Appends to existing array of JAXP 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.
| |
| getClientSideXSLTStylesheetURLs | back to summary |
|---|---|
| public String[] getClientSideXSLTStylesheetURLs() Returns specified array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. Default is null The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Returns the MIME type for the resulting page.
Defaults to | |
| getCSSStylesheetURLs | back to summary |
|---|---|
| public String[] getCSSStylesheetURLs() Returns specified array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. 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. | |
| getCustomMathJaxUrl | back to summary |
|---|---|
| public String getCustomMathJaxUrl() | |
| getLang | back to summary |
|---|---|
| public String getLang() Returns the language of the resulting page, null if not set.
Defaults to | |
| getMathPrefRenderer | back to summary |
|---|---|
| public String getMathPrefRenderer() Gets the value of the optional pref:renderer attribute
(in the The default is null, indicating that no attribute will be added
| |
| getStylesheets | back to summary |
|---|---|
| public Transformer[] getStylesheets() Returns an array of specified JAXP 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. | |
| getTitle | back to summary |
|---|---|
| public String getTitle() Returns the title for the resulting page, null if not set. Default is null.
This is used to generate a title and possible a h1
header if | |
| getWebPageType | back to summary |
|---|---|
| public WebPageOutputOptions. Deprecated Use various methods in Before SnuggleTeX 1.3.0, this returned the desired "type" of web page to be constructed. From SnuggleTeX 1.3.0, this property no longer controls anything.
| |
| isAddingMathPlayerImport | back to summary |
|---|---|
| public boolean isAddingMathPlayerImport() Returns whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin.
| |
| isAddingTitleHeading | back to summary |
|---|---|
| public boolean isAddingTitleHeading() Returns whether page title should be inserted at the start of the web page body as an XHTML h1 element. Default is false.
This has no effect if | |
| isHtml5 | back to summary |
|---|---|
| public boolean isHtml5() | |
| isIncludingStyleElement | back to summary |
|---|---|
| public boolean isIncludingStyleElement() Returns whether to include SnuggleTeX-related CSS as a 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
As of SnuggleTeX 1.2.3, this option is ignored if Default is true, as that's the simplest way of getting up to speed quickly. | |
| isMathJax | back to summary |
|---|---|
| public boolean isMathJax() | |
| isNoCharsetInContentTypeHeader | back to summary |
|---|---|
| public boolean isNoCharsetInContentTypeHeader() | |
| setAddingMathPlayerImport | back to summary |
|---|---|
| public void setAddingMathPlayerImport(boolean addingMathPlayerImport) Sets whether to include the necessary processing instruction and object element required to explicitly trigger the MathPlayer plugin.
| |
| setAddingTitleHeading | back to summary |
|---|---|
| public void setAddingTitleHeading(boolean addingTitleHeading) Sets whether page title should be inserted at the start of the web page body as an XHTML h1 element.
This has no effect if
| |
| setClientSideXSLTStylesheetURLs | back to summary |
|---|---|
| public void setClientSideXSLTStylesheetURLs(String... clientSideXSLTStylesheetURLs) Sets an array of relative URLs specifying client-side XSLT stylesheets to be referenced in the resulting page. The URLs are used as-is; the caller should have ensured they make sense in advance!
This is ignored for
| |
| setContentType | back to summary |
|---|---|
| public void setContentType(String contentType) Sets the MIME type for the resulting page.
| |
| setCSSStylesheetURLs | back to summary |
|---|---|
| public void setCSSStylesheetURLs(String... cssStylesheetURLs) Specifies an array of relative URLs specifying client-side CSS stylesheets to be referenced in the resulting page. 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.
| |
| setCustomMathJaxUrl | back to summary |
|---|---|
| public void setCustomMathJaxUrl(String mathJaxPath) | |
| setHtml5 | back to summary |
|---|---|
| public void setHtml5(boolean html5) | |
| setIncludingStyleElement | back to summary |
|---|---|
| public void setIncludingStyleElement(boolean includingStyleElement) Sets whether to include SnuggleTeX-related CSS as a 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
As of SnuggleTeX 1.2.3, this option is ignored if
| |
| setLang | back to summary |
|---|---|
| public void setLang(String lang) Sets the language of the resulting page.
| |
| setMathJax | back to summary |
|---|---|
| public void setMathJax(boolean mathJax) | |
| setMathPrefRenderer | back to summary |
|---|---|
| public void setMathPrefRenderer(String mathPrefRenderer) Sets the value of the optional pref:renderer attribute
(in the A null value is allowed, which prevents such an attribute being added.
| |
| setNoCharsetInContentTypeHeader | back to summary |
|---|---|
| public void setNoCharsetInContentTypeHeader(boolean noCharsetInContentTypeHeader) | |
| setStylesheets | back to summary |
|---|---|
| public void setStylesheets(Transformer... stylesheets) Sets an array of JAXP 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.
| |
| setTitle | back to summary |
|---|---|
| public void setTitle(String title) Sets the title for the resulting page.
This is used to generate a title and possible a h1
header if
| |
| setWebPageType | back to summary |
|---|---|
| public void setWebPageType(WebPageOutputOptions. Deprecated Use various methods in Before SnuggleTeX 1.3.0, this returned the desired "type" of web page to be constructed. From SnuggleTeX 1.3.0, this property no longer controls anything.
| |
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.
WebPageOutputOptionsBuilder instead.
| Modifier and Type | Field and Description |
|---|---|
| public static final WebPageOutputOptions. | CLIENT_SIDE_XSLT_STYLESHEET
Deprecated
Use XHTML + MathML containing one or more processing instructions designed to invoke
client-side XSLT.
WebPageOutputOptionsBuilder#createUniversalStylesheetOptions(String)
if you really need this, otherwise consider some of the MathJax outputs for better
cross-browser impact.
|
| public static final WebPageOutputOptions. | CROSS_BROWSER_XHTML
Deprecated
Use "Cross-browser" XHTML + MathML; has XML declaration and DOCTYPE declaration
consisting of the Public identifier defined in WebPageOutputOptionsBuilder#createLegacyCrossBrowserOptions()
if you really need this, otherwise consider some of the MathJax outputs for better
cross-browser impact.
W3CConstants#XHTML_11_MATHML_20_PUBLIC_IDENTIFIER
and System identifier defined in W3CConstants#XHTML_11_MATHML_20_SYSTEM_IDENTIFIER.
|
| public static final WebPageOutputOptions. | MATHPLAYER_HTML
Deprecated
See HTML + MathML intended for Internet Explorer 6/7 with the MathPlayer plug-in.
WebPageOutputOptionsBuilder#createIEMathPlayerSpecificOptions()
if you really need this, otherwise consider some of the MathJax outputs for better
cross-browser impact.
Intended to be served as text/html. |
| public static final WebPageOutputOptions. | MOZILLA
Deprecated
Use Mozilla-compatible output.
WebPageOutputOptionsBuilder#createMozillaSpecificOptions() if
you really need this, otherwise consider some of the MathJax outputs for better
cross-browser impact.
|
| public static final WebPageOutputOptions. | PROCESSED_HTML
Deprecated
Use HTML deemed suitable for use by any User Agent.
WebPageOutputOptionsBuilder#createHTML4Options()
|
| public static final WebPageOutputOptions. | UNIVERSAL_STYLESHEET
Deprecated
Use "Cross-browser" XHTML + MathML suitable for Mozilla and Internet Explorer 6/7.
WebPageOutputOptionsBuilder#createUniversalStylesheetOptions(String)
if you really need this, otherwise consider some of the MathJax outputs for better
cross-browser impact.
|
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public static WebPageOutputOptions. | valueOf(String name)
References Deprecated
WebPageOutputOptions.WebPageType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| public static WebPageOutputOptions. | values()
References Deprecated
WebPageOutputOptions.WebPageType is deprecated or references (maybe indirectly) at least one deprecated element.
|
| CLIENT_SIDE_XSLT_STYLESHEET | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated Use XHTML + MathML containing one or more processing instructions designed to invoke client-side XSLT. No XML declaration and no DOCTYPE. Intended to be served as application/xhtml+xml. Combining this with the Universal Math Stylesheet or something similar can give good cross-browser results. | |
| CROSS_BROWSER_XHTML | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated Use "Cross-browser" XHTML + MathML; has XML declaration and DOCTYPE declaration
consisting of the Public identifier defined in Intended to be served as application/xhtml+xml Works on both Mozilla and IE6/7 (provided MathPlayer has been installed). This will display wrongly on IE6/7 if MathPlayer is not installed. The main issue with this is that IE will want to download the relevant DTD, which hinders performance slightly. | |
| MATHPLAYER_HTML | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated See HTML + MathML intended for Internet Explorer 6/7 with the MathPlayer plug-in. Intended to be served as text/html. This only works on IE clients with the MathPlayer plug-in preinstalled, but is a good option if that's your target audience. This will display wrongly on IE6/7 if MathPlayer is not installed. | |
| MOZILLA | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated Use Mozilla-compatible output. XHTML + MathML; no XML declaration; no DOCTYPE. This is intended to be served as application/xhtml+xml with encoding declared via HTTP header and meta element. This is the best option for serving content exclusively on Mozilla-based browsers. This will display as an XML tree on IE, which is not useful. | |
| PROCESSED_HTML | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated HTML deemed suitable for use by any User Agent. Intended to be served as text/html.
You will have to use a suitable | |
| UNIVERSAL_STYLESHEET | back to summary |
|---|---|
| public static final WebPageOutputOptions. Deprecated Use "Cross-browser" XHTML + MathML suitable for Mozilla and Internet Explorer 6/7. Intended to be used in conjunction with the client-side Universal StyleSheet XSLT to accommodate the two cases, prompting for the download of MathPlayer on IE6/7 if it is not already installed. Page is created with an XML declaration but no DOCTYPE declaration. The pref:renderer attribute on the html element will be set to mathplayer-dl.
You MUST also call
NotesThe SnuggleTeX source distribution contains a slightly fixed version of the USS that works in IE7 that you can use if you like. | |
| WebPageType | back to summary |
|---|---|
| private WebPageType() | |
| valueOf | back to summary |
|---|---|
| public static WebPageOutputOptions. References Deprecated
See corresponding docs for further information. | |
| values | back to summary |
|---|---|
| public static WebPageOutputOptions. References Deprecated
See corresponding docs for further information. | |