public static enum LexicalPreservationBase.PreserveItem extends java.lang.Enum<LexicalPreservationBase.PreserveItem>
Enum Constant and Description |
---|
ATTRIBUTES
The item is used to add a
preserve:defaultAttributes attribute to any element that has defaulted attributes. |
CDATA
The item is used to transform CDATA into a
preserve:cdata element for comparison. |
COMMENT
This item is used to transform a comment into the
preserve:comment element for comparison. |
CONTENT_MODEL
This item represents attributes added at parse time using Schema/DTD validation or inferred data to provide information on
the element content.
|
DOCTYPE
The item is used to indicate that the DOCTYPE and its internal subset should be preserved.
|
DOCUMENT_LOCATION
This item represent the original location, or systemId, of the document when it was parsed.
|
ENTITY_REF
The item is used to transform entity references into a
er:entityname element for comparison. |
ENTITY_REPLACEMENT_TEXT
The item is used to indicate that an entity reference should be expanded for comparison.
|
IGNORABLE_WHITESPACE
This item is used to mark ignorable whitespace characters (whitespace-only text nodes where it is known that the parent
element cannot contain PCDATA) into ordinary whitespace characters by wrapping them in a
preserve:ignorable
element. |
INNER_ENTITY_REF
The item is used to transform entity references that appear within an expanded entity reference into a
er:entityname element for comparison. |
PROCESS_INST
This item is used to transform a processing instruction into the
pi:tag for comparison. |
XML_DECL
The item is used to indicate that the XML declaration should be preserved.
|
Modifier and Type | Method and Description |
---|---|
static LexicalPreservationBase.PreserveItem |
get(java.lang.String label)
Get the preserve item associated with the given label.
|
java.lang.String |
toString()
The label that is used to identify this preserve item.
|
static LexicalPreservationBase.PreserveItem |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name.
|
static LexicalPreservationBase.PreserveItem[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final LexicalPreservationBase.PreserveItem DOCTYPE
public static final LexicalPreservationBase.PreserveItem XML_DECL
The XML version and character encoding declarations are provided by the optional org.xml.sax.ext.Locator2 interface, which is supplied as the argument to the setDocumentLocator SAX event (when available).
Note: although it is possible to detect the standalone XML declaration via the optional "http://xml.org/sax/features/is-standalone" feature, there are several pragmatic difficulties with doing this reliably in all contexts (even when the parser supports this feature). Further, due to limitations on the output serialization technology that is being used, it is difficult to reliably support both DOCTYPE preservation and the setting of the standalone XML declaration. Therefore, standalone preservation support is currently not supported.
public static final LexicalPreservationBase.PreserveItem ATTRIBUTES
preserve:defaultAttributes
attribute to any element that has defaulted attributes.
The content of this attribute is the list of attributes that have been expanded by the XML parser.
Note that defaulted attributes are provided by the optional org.xml.sax.ext.Attributes2 interface. XML Parsers that do not implement this interface will not provide this filter with the information as to whether an attribute value was provided by a DTD or was explicitly set in the XML document.
public static final LexicalPreservationBase.PreserveItem ENTITY_REF
er:entityname
element for comparison.public static final LexicalPreservationBase.PreserveItem INNER_ENTITY_REF
er:entityname
element for comparison.public static final LexicalPreservationBase.PreserveItem ENTITY_REPLACEMENT_TEXT
er:entityname
element)public static final LexicalPreservationBase.PreserveItem CDATA
preserve:cdata
element for comparison.public static final LexicalPreservationBase.PreserveItem COMMENT
preserve:comment
element for comparison. Comments outside
the XML body are contained in either a preserve:doctype
element or a preserve:pi-and-comment
element whose region attribute is one of LexicalPreservationBase.Region.BEFORE_DTD
, LexicalPreservationBase.Region.AFTER_DTD
, or LexicalPreservationBase.Region.AFTER_BODY
.public static final LexicalPreservationBase.PreserveItem PROCESS_INST
pi:tag
for comparison. Processing
instructions outside the XML body are contained in either a preserve:doctype
element or a
preserve:pi-and-comment
element whose region attribute is one of LexicalPreservationBase.Region.BEFORE_DTD
,
LexicalPreservationBase.Region.AFTER_DTD
, or LexicalPreservationBase.Region.AFTER_BODY
.public static final LexicalPreservationBase.PreserveItem IGNORABLE_WHITESPACE
preserve:ignorable
element.
Note that a DTD (or some schema for a schema aware parser) is required for the parser to know when a whitespace character is ignorable.
public static final LexicalPreservationBase.PreserveItem CONTENT_MODEL
Note that a DTD or schema with appropriate SAX parser feature settings is required for the parser to determine this information most reliably.
public static final LexicalPreservationBase.PreserveItem DOCUMENT_LOCATION
This item represent the original location, or systemId, of the document when it was parsed. This information may not be available if the inputs were loaded from a stream that did not have the relevant information set.
The document location is added to the input document using an xml:base attribute on the root node.
N.B. If the xml:base attribute is already present on the parsed input, it will NOT be replaced.
public static LexicalPreservationBase.PreserveItem[] values()
for (LexicalPreservationBase.PreserveItem c : LexicalPreservationBase.PreserveItem.values()) System.out.println(c);
public static LexicalPreservationBase.PreserveItem valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.java.lang.IllegalArgumentException
- if this enum type has no constant with the specified namejava.lang.NullPointerException
- if the argument is nullpublic java.lang.String toString()
toString
in class java.lang.Enum<LexicalPreservationBase.PreserveItem>
public static LexicalPreservationBase.PreserveItem get(java.lang.String label)
label
- the label that is used to identify this preserve item.