Generated by
JDiff

com.itextpdf.styledxmlparser.jsoup.nodes Documentation Differences

This file contains all the changes in documentation in the package com.itextpdf.styledxmlparser.jsoup.nodes as colored differences. Deletions are shown like this , and additions are shown like this.
If no deletions or additions are shown in an entry, the HTML tags will be what has changed. The new HTML tags are shown in the differences. If no documentation existed, and then some was added in a later version, this change is noted in the appropriate class pages of differences, but the change is not shown on this page. Only changes in existing text are shown here. Similarly, documentation which was inherited from another class or interface is not shown here.
Note that an HTML error in the new documentation may cause the display of other documentation changes to be presented incorrectly. For instance, failure to close a tag will cause all subsequent paragraphs to be displayed differently.

Class Attributes

The attributes of an Element.

Attributes are treated as a map: there can be only one value associated with an attribute key.

Attribute key and value comparisons are done case insensitively, and keys are normalised to lower-case. @author Jonathan Hedley, jonathan@hedley.net


Class Document, void charset(Charset)

Sets the charset used in this document. This method is equivalent to OutputSettings.charset(Charset) but in addition it updates the charset / encoding element within the document.

This enables meta charset update.

If there's no element with charset / encoding information yet it will be created. Obsolete charset / encoding definitions are removed!

Elements used:

@param charset Charset @see #updateMetaCharsetElement(boolean) @see OutputSettings#charset(java.nio.charset.Charset)
Class Document, void updateMetaCharsetElement(boolean)

Sets whether the element with charset information in this document is updated on changes through Document.charset(Charset) or not.

If set to false (default) there are no elements modified. @param update If true the element updated on charset changes, false if not @see #charset(java.nio.charset.Charset)


Class Element, Element child(int)

Get a child element of this element, by its 0-based index number.

Note that an element can have both mixed Nodes and Elements as children. This method inspects a filtered list of children that are elements, and the index is based on that filtered list. @param index the index number of the element to retrieve @return the child element, if it exists, otherwise throws an {@code IndexOutOfBoundsException} @see #childNode(int)

Class Element, Elements children()

Get this element's child elements.

This is effectively a filter on .childNodes() to get Element nodes. @return child elements. If this element has no children, returns an empty list. @see #childNodes()

Class Element, String cssSelector()

Get a CSS selector that will uniquely select this element.

If the element has an ID, returns #id; otherwise returns the parent (if any) CSS selector, followed by {@literal '>'}, followed by a unique selector for the element (tag.class.class:nth-child(n)). @return the CSS Path that can be used to retrieve the element in a selector.

Class Element, List dataNodes()

Get this element's child data nodes. The list is unmodifiable but the data nodes may be manipulated.

This is effectively a filter on .childNodes() to get Data nodes. @return child data nodes. If this element has no data nodes, returns an empty list. @see #data()

Class Element, Element nextElementSibling()

Gets the next sibling element of this element. E.g., if a {@code div} contains two {@code p}s, the {@code nextElementSibling} of the first {@code p} is the second {@code p}.

This is similar to .nextSibling(), but specifically finds only Elements Elements @return the next element, or null if there is no next element @see #previousElementSibling()

Class Element, Elements select(String)

Find elements that match the Selector CSS query, with this element as the starting context. Matched elements may include this element, or any of its children.

This method is generally more powerful to use than the DOM-type {@code getElementBy*} methods, because multiple filters can be combined, e.g.:

See the query syntax documentation in Selector. @param cssQuery a Selector CSS-like query @return elements that match the query (empty if none match) @see Selector @throws Selector.SelectorParseException (unchecked) on an invalid CSS query.
Class Element, List textNodes()

Get this element's child text nodes. The list is unmodifiable but the text nodes may be manipulated.

This is effectively a filter on .childNodes() to get Text nodes. @return child text nodes. If this element has no text nodes, returns an empty list.

For example, with the input HTML: {@code

One Two Three
Four

} with the {@code p} element selected:

Class Node, String absUrl(String)

Get an absolute URL from a URL attribute that may be relative (i.e. an or ).

E.g.: String absUrl = linkEl.absUrl("href");

If the attribute value is already absolute (i.e. it starts with a protocol, like http:// or https:// etc), and it successfully parses as a URL, the attribute is returned directly. Otherwise, it is treated as a URL relative to the element's .baseUri, and made absolute using that.

As an alternate, you can use the .attr method with the abs: prefix, e.g.: String absUrl = linkEl.attr("abs:href"); @param attributeKey The attribute key @return An absolute URL if one could be made, or an empty string (not null) if the attribute was missing or could not be made successfully into a URL. @see #attr @see java.net.URL#URL(java.net.URL, String)

Class Node, String attr(String)

Get an attribute's value by its key.

To get an absolute URL from an attribute that may be a relative URL, prefix the key with abs, which is a shortcut to the .absUrl method.

E.g.:

String url = a.attr("abs:href");
@param attributeKey The attribute key. @return The attribute, or empty string if not present (to avoid nulls). @see #attributes() @see #hasAttr(String) @see #absUrl(String)
Class Node, Node unwrap()

Removes this node from the DOM, and moves its children up into the node's parent. This has the effect of dropping the node but keeping its children.

For example, with the input html:

{@code

One Two Three
}

Calling {@code element.unwrap()} on the {@code span} element will result in the html:

{@code

One Two Three
}

and the {@code "Two "} TextNode being returned. @return the first child of this node, after the node has been unwrapped. Null if the node had no children. @see #remove() @see #wrap(String)