public enum SerializationMethod extends java.lang.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.
| 枚举常量和说明 |
|---|
HTML
Default ("Partial") HTML serialization method.
|
STRICTLY_HTML
Pure HTML serialization method.
|
XHTML
XHTML Serialization method (if available)
|
XML
XML Serialization method
|
| 限定符和类型 | 方法和说明 |
|---|---|
java.lang.String |
getName() |
static SerializationMethod |
valueOf(java.lang.String name)
返回带有指定名称的该类型的枚举常量。
|
static SerializationMethod[] |
values()
按照声明该枚举类型的常量的顺序, 返回
包含这些常量的数组。
|
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(java.lang.String name)
name - 要返回的枚举常量的名称。java.lang.IllegalArgumentException - 如果该枚举类型没有带有指定名称的常量java.lang.NullPointerException - 如果参数为空值public java.lang.String getName()