Class XmlHtml
java.lang.Object
org.libxmq.imp.xml.XmlHtml
The html tables of libxml2 2.16 used by the html parser and the html writer:
the elements, which start tags implicitly close which open elements, the end tag
priorities, the elements allowing pcdata, the boolean attributes and the html5
named character references. A port of xml_html.c.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intPlain text, the rest of the input.static final intRaw text, eg style.static final intThe data modes (tokenizer states) of the content of an element.static final intScript data.static final intScript data after <!static final intScript data after <! -
Method Summary
Modifier and TypeMethodDescriptionstatic booleanallowsPcdata(String name) Elements where ignorable whitespace is kept since they allow pcdata.static XmlHtml.ElementLook up an html element (case insensitive), null if unknown.static intendPriority(String name) The end tag priority: an end tag only closes elements with lower or equal priority.static byte[]findEntityPrefix(byte[] s, int off, int slen, boolean is_attr, int[] nlen) Find the longest html5 named character reference that is a prefix of the bytes s[off..off+slen) (which start after the &), port of libxml2 htmlFindEntityPrefix.static booleanisBooleanAttr(String name) Attributes written in minimized form, eg checked or selected (case insensitive), libxml2 htmlIsBooleanAttr.static booleanstartCloses(String new_tag, String old_tag) Does a start tag new_tag implicitly close an open element old_tag?
-
Field Details
-
DATA_RCDATA
public static final int DATA_RCDATAThe data modes (tokenizer states) of the content of an element.- See Also:
-
DATA_RAWTEXT
public static final int DATA_RAWTEXTRaw text, eg style.- See Also:
-
DATA_PLAINTEXT
public static final int DATA_PLAINTEXTPlain text, the rest of the input.- See Also:
-
DATA_SCRIPT
public static final int DATA_SCRIPTScript data.- See Also:
-
DATA_SCRIPT_ESC1
public static final int DATA_SCRIPT_ESC1Script data after <!--.- See Also:
-
DATA_SCRIPT_ESC2
public static final int DATA_SCRIPT_ESC2Script data after <!--<script.- See Also:
-
-
Method Details
-
element
Look up an html element (case insensitive), null if unknown.- Parameters:
name- The element name.- Returns:
- The element or null.
-
startCloses
-
endPriority
The end tag priority: an end tag only closes elements with lower or equal priority.- Parameters:
name- The element name.- Returns:
- The priority.
-
allowsPcdata
Elements where ignorable whitespace is kept since they allow pcdata.- Parameters:
name- The element name.- Returns:
- True if the element allows pcdata.
-
isBooleanAttr
Attributes written in minimized form, eg checked or selected (case insensitive), libxml2 htmlIsBooleanAttr.- Parameters:
name- The attribute name.- Returns:
- True if boolean.
-
findEntityPrefix
public static byte[] findEntityPrefix(byte[] s, int off, int slen, boolean is_attr, int[] nlen) Find the longest html5 named character reference that is a prefix of the bytes s[off..off+slen) (which start after the &), port of libxml2 htmlFindEntityPrefix.- Parameters:
s- The input bytes.off- The offset of the reference name.slen- The number of bytes available.is_attr- True inside an attribute value.nlen- Set to the number of bytes of the reference (excluding the &, including a ; if present).- Returns:
- The utf8 replacement, or null if there is none.
-