public enum SerializationMethod extends Enum<SerializationMethod>
This is based on XSLT 2, but provides two HTML serialization methods - one which keeps non-XHTML in a namespace and one which moves everything into the null namespace.
NOTE: XHTML is only supported if you are using an XSLT 2.0 processor. If not supported, you will get XML output.
| Enum Constant and Description |
|---|
HTML
Default ("Partial") HTML serialization method.
|
STRICTLY_HTML
Pure HTML serialization method.
|
XHTML
XHTML Serialization method (if available)
|
XML
XML Serialization method
|
| Modifier and Type | Method and Description |
|---|---|
String |
getName() |
static SerializationMethod |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static SerializationMethod[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final SerializationMethod XML
public static final SerializationMethod XHTML
public static final SerializationMethod HTML
HTML elements are serialized in NO namespace, XML elements in the MathML and other namespaces are kept as-is
(This is how you might serialize HTML for IE/MathPlayer, for example)
NOTE: The old version of Xalan that comes bundled with Java 6 (and below) appears to be
unable to indent HTML output when using XMLStringOutputOptions.setIndenting(boolean).
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.
public static final SerializationMethod STRICTLY_HTML
All XML elements have their namespaces removed on serialization. (Hence, there is the potential for name clashes if you use something like XLink & XHTML together.)
(This is how you would serialize HTML5, for example.)
public static SerializationMethod[] values()
for (SerializationMethod c : SerializationMethod.values()) System.out.println(c);
public static SerializationMethod valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic String getName()
Copyright © 2008–2026 The University of Edinburgh. All rights reserved.