|
@@ -105,10 +105,30 @@ public interface XMLElement extends Wrapper<String> {
|
|
|
return W3ElementFactory.fromStream(doc);
|
|
return W3ElementFactory.fromStream(doc);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns document which owns this element
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method does not return root node of XML document.
|
|
|
|
|
+ * To obtain root element, please use {@link #root}
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLDocument
|
|
|
|
|
+ */
|
|
|
XMLDocument document();
|
|
XMLDocument document();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns root parent of this element
|
|
|
|
|
+ * If this element is root, returns it.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElement
|
|
|
|
|
+ */
|
|
|
XMLElement root();
|
|
XMLElement root();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns type of this element.
|
|
|
|
|
+ * For example XMLElement can represent attribute, tag, or text fragment.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLType
|
|
|
|
|
+ */
|
|
|
XMLType nodetype();
|
|
XMLType nodetype();
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -117,101 +137,483 @@ public interface XMLElement extends Wrapper<String> {
|
|
|
* @return this
|
|
* @return this
|
|
|
*/
|
|
*/
|
|
|
Node node();
|
|
Node node();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns name of this element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Please note that different node types return different results:
|
|
|
|
|
+ * ELEMENT tag name
|
|
|
|
|
+ * ATTRIBUTE attribute name
|
|
|
|
|
+ *
|
|
|
|
|
+ * ENTITY name of entity
|
|
|
|
|
+ * REFERENCE name of referenced entity
|
|
|
|
|
+ * PROCESSING processing instruction target
|
|
|
|
|
+ * DOCTYPE doctype name
|
|
|
|
|
+ * NOTATION notation name
|
|
|
|
|
+ *
|
|
|
|
|
+ * DOCUMENT "#document"
|
|
|
|
|
+ * FRAGMENT "#document-fragment"
|
|
|
|
|
+ * TEXT "#text"
|
|
|
|
|
+ * CDATA "#cdata-section"
|
|
|
|
|
+ * COMMENT "#comment"
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return String
|
|
|
|
|
+ */
|
|
|
String name();
|
|
String name();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns XPATH to this element
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return String
|
|
|
|
|
+ */
|
|
|
String xpath();
|
|
String xpath();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns content of this element
|
|
|
|
|
+ *
|
|
|
|
|
+ * Please note that different node types return different results:
|
|
|
|
|
+ * ELEMENT null!
|
|
|
|
|
+ *
|
|
|
|
|
+ * ATTRIBUTE attribute value
|
|
|
|
|
+ * TEXT content of text node
|
|
|
|
|
+ * COMMENT content of the comment
|
|
|
|
|
+ * CDATA content of CDATA section
|
|
|
|
|
+ * PROCESSING content of processing instruction
|
|
|
|
|
+ *
|
|
|
|
|
+ * ENTITY null
|
|
|
|
|
+ * REFERENCE null
|
|
|
|
|
+ * DOCTYPE null
|
|
|
|
|
+ * NOTATION null
|
|
|
|
|
+ * DOCUMENT null
|
|
|
|
|
+ * FRAGMENT null
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return String
|
|
|
|
|
+ */
|
|
|
String content();
|
|
String content();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns text content inside this element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * If this node returns non-null content, then it is returned.
|
|
|
|
|
+ * Otherwise, it returns concatenation of "text" from all child nodes.
|
|
|
|
|
+ * It returns empty string, if it has no children.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Exceptions:
|
|
|
|
|
+ * DOCUMENT and NOTATION will return null!
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return String or null
|
|
|
|
|
+ */
|
|
|
String text();
|
|
String text();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all attributes of this elements, as XMLElements collection.
|
|
|
|
|
+ *
|
|
|
|
|
+ * XMLElements is universal collection.
|
|
|
|
|
+ * You can use it to process list of attributes, tag elements or comment sections.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements attrs();
|
|
XMLElements attrs();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns first attribute with specified name
|
|
|
|
|
+ *
|
|
|
|
|
+ * Throws NoSuchElementException if there is no attribute.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param name name
|
|
|
|
|
+ * @return XMLElement
|
|
|
|
|
+ */
|
|
|
XMLElement attr(String name);
|
|
XMLElement attr(String name);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Compiles provided expression to XMLSelector and returns elements matched by it.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Generally, this method searches recursively for any matching element.
|
|
|
|
|
+ * If you want to select only direct children matching provided expression, lets use {@link #children(String)}
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns empty collection if there is no matching elements.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements find(String selector);
|
|
XMLElements find(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns elements matched by provided XMLSelector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Generally, this method searches recursively for any matching element.
|
|
|
|
|
+ * If you want to select only direct children matching provided expression, lets use {@link #children(Predicate)}
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns empty collection if there is no matching elements.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements find(XMLSelector selector);
|
|
XMLElements find(XMLSelector selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns list of direct children
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns empty collection element does not have children.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements children();
|
|
XMLElements children();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns list of direct children filtered by provided selector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method does not search recursively.
|
|
|
|
|
+ * If you want to search recursively for any matching element, lets use {@link #find(String)}
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns empty collection if there is no matching children.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements children(String selector);
|
|
XMLElements children(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns list of direct children filtered by provided predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * This method does not search recursively.
|
|
|
|
|
+ * If you want to search recursively for any matching element,
|
|
|
|
|
+ * and your selector is XMLSelector, you can use {@link #find(XMLSelector)}.
|
|
|
|
|
+ *
|
|
|
|
|
+ * There is no way to recursively scan by predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @todo xml: implement recursive scan by predicate
|
|
|
|
|
+ * in fact it should be just "find(Predicate)" which
|
|
|
|
|
+ * internally runs recursive traversal
|
|
|
|
|
+ * or runs "find(XMLSelector)" if predicate is XMLSelector
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns empty collection if there is no matching children.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements children(Predicate<XMLContext> selector);
|
|
XMLElements children(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns true, if this element has any children
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return boolean
|
|
|
|
|
+ */
|
|
|
boolean has();
|
|
boolean has();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns true, if this element has any direct child matching selector
|
|
|
|
|
+ *
|
|
|
|
|
+ * There is no method to make recursive check, but you can call {@code find(selector).has()}.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return boolean
|
|
|
|
|
+ */
|
|
|
boolean has(String selector);
|
|
boolean has(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns true, if this element has any direct child matching predicate
|
|
|
|
|
+ *
|
|
|
|
|
+ * There is no method to make recursive check, but you can call {@code find(selector).has()}.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return boolean
|
|
|
|
|
+ */
|
|
|
boolean has(Predicate<XMLContext> selector);
|
|
boolean has(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns next sibling of element
|
|
|
|
|
+ * Returns null if there is no next sibling.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElement?
|
|
|
|
|
+ */
|
|
|
XMLElement next();
|
|
XMLElement next();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all next siblings matched by provided selector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements next(String selector);
|
|
XMLElements next(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all next siblings accepted by provided predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements next(Predicate<XMLContext> selector);
|
|
XMLElements next(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns previous sibling of element
|
|
|
|
|
+ * Returns null if there is no previous sibling.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElement?
|
|
|
|
|
+ */
|
|
|
XMLElement prev();
|
|
XMLElement prev();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all previous siblings matched by provided selector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements prev(String selector);
|
|
XMLElements prev(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all previous siblings accepted by provided predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements prev(Predicate<XMLContext> selector);
|
|
XMLElements prev(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns direct parent of this element
|
|
|
|
|
+ * Returns null if there is no parent element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElement?
|
|
|
|
|
+ */
|
|
|
XMLElement parent();
|
|
XMLElement parent();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns parent chain for this element
|
|
|
|
|
+ *
|
|
|
|
|
+ * Elements are ordered from direct parent to root parent.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements parents();
|
|
XMLElements parents();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns those elements from parents chain which match selector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Elements are ordered from direct parent to root parent.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements parents(String selector);
|
|
XMLElements parents(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns those elements from parents chain which are accepted by predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Elements are ordered from direct parent to root parent.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements parents(Predicate<XMLContext> selector);
|
|
XMLElements parents(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all siblings of element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements siblings();
|
|
XMLElements siblings();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all siblings matched by provided selector.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements siblings(String selector);
|
|
XMLElements siblings(String selector);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Returns all siblings accepted by provided predicate.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param selector selector
|
|
|
|
|
+ * @return XMLElements
|
|
|
|
|
+ */
|
|
|
XMLElements siblings(Predicate<XMLContext> selector);
|
|
XMLElements siblings(Predicate<XMLContext> selector);
|
|
|
-
|
|
|
|
|
-
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Normalization merges all text nodes and removes empty text nodes.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement normalize();
|
|
XMLElement normalize();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Removes all child nodes.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement clear();
|
|
XMLElement clear();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Inserts provided element before this one. That means: "element" will be previous sibling.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param element element
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement before(XMLElement element);
|
|
XMLElement before(XMLElement element);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Inserts provided element after this one. That means: "element" will be next sibling.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param element element
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement after(XMLElement element);
|
|
XMLElement after(XMLElement element);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Inserts provided element into this one, before any children nodes. That means, as first child.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param element element
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement prepend(XMLElement element);
|
|
XMLElement prepend(XMLElement element);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Inserts provided element into this one, after any children nodes. That means, as last child.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param element element
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement append(XMLElement element);
|
|
XMLElement append(XMLElement element);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Replaces this element by provided one.
|
|
|
|
|
+ * That means: this element will be removed from document, and provided one will be inserted instead.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns this element in detached state.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param element element
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement replace(XMLElement element);
|
|
XMLElement replace(XMLElement element);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Changes name of this element.
|
|
|
|
|
+ * Operation is supported only for attributes and tags.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Throws exception if operation is unsupported.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param tagname tagname
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement rename(String tagname);
|
|
XMLElement rename(String tagname);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Removes this element from document.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns this element in detached state.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement remove();
|
|
XMLElement remove();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Wraps this element by provided tag.
|
|
|
|
|
+ * That means: first it will be replaced by new "tagname" and then will be inserted into this "tagname"
|
|
|
|
|
+ *
|
|
|
|
|
+ * Returns newly created wrapper element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param tagname tagname
|
|
|
|
|
+ * @return XMLElement
|
|
|
|
|
+ */
|
|
|
XMLElement wrap(String tagname);
|
|
XMLElement wrap(String tagname);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Removes from document enclosing tag with all children and puts into its place only this element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement unwrap();
|
|
XMLElement unwrap();
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Changes content of this node.
|
|
|
|
|
+ *
|
|
|
|
|
+ * If this node is ELEMENT, it replaces its children by provided element.
|
|
|
|
|
+ * Otherwise, it reads text content from provided element and assigns it.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param value value
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement content(XMLElement value);
|
|
XMLElement content(XMLElement value);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Changes content of this node.
|
|
|
|
|
+ *
|
|
|
|
|
+ * If this node is ELEMENT, parses provided markup into XML nodes and replaces current children by those new nodes.
|
|
|
|
|
+ * Otherwise, it just assigns provided text value to element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param value value
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement content(String value);
|
|
XMLElement content(String value);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Changes text content of this node.
|
|
|
|
|
+ *
|
|
|
|
|
+ * If this node is ELEMENT, it removes all children and puts new TEXT element into it.
|
|
|
|
|
+ * Otherwise, it just assigns provided text to element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param value value
|
|
|
|
|
+ * @return this
|
|
|
|
|
+ */
|
|
|
XMLElement text(String value);
|
|
XMLElement text(String value);
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Executes provided transformer against document subtree represented by this element and
|
|
|
|
|
+ * creates new output document. Returns new tree generated by transformer
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param transformer transformer
|
|
|
|
|
+ * @return XMLElement
|
|
|
|
|
+ * @throws XMLException on error
|
|
|
|
|
+ */
|
|
|
XMLElement apply(Transformer transformer) throws XMLException;
|
|
XMLElement apply(Transformer transformer) throws XMLException;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Executes provided transformer against document subtree represented by this element and
|
|
|
|
|
+ * creates new output document. Returns new tree generated by transformer
|
|
|
|
|
+ *
|
|
|
|
|
+ * Assumes that provided argument is correctly loaded XSLT document and uses it to create XML transformation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param transformer transformer
|
|
|
|
|
+ * @return XMLElement
|
|
|
|
|
+ * @throws XMLException on error
|
|
|
|
|
+ */
|
|
|
XMLElement apply(XMLElement transformer) throws XMLException;
|
|
XMLElement apply(XMLElement transformer) throws XMLException;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Executes provided transformer against document subtree represented by this element and
|
|
|
|
|
+ * stores generated result into "output" object.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param transformer transformer
|
|
|
|
|
+ * @param output output
|
|
|
|
|
+ * @param <R> R
|
|
|
|
|
+ * @return output
|
|
|
|
|
+ * @throws XMLException on error
|
|
|
|
|
+ */
|
|
|
<R extends Result> R apply(Transformer transformer, R output) throws XMLException;
|
|
<R extends Result> R apply(Transformer transformer, R output) throws XMLException;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Executes provided transformer against document subtree represented by this element and
|
|
|
|
|
+ * stores generated result into "output" object.
|
|
|
|
|
+ *
|
|
|
|
|
+ * Assumes that provided argument is correctly loaded XSLT document and uses it to create XML transformation.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param transformer transformer
|
|
|
|
|
+ * @param output output
|
|
|
|
|
+ * @param <R> R
|
|
|
|
|
+ * @return output
|
|
|
|
|
+ * @throws XMLException on error
|
|
|
|
|
+ */
|
|
|
<R extends Result> R apply(XMLElement transformer, R output) throws XMLException;
|
|
<R extends Result> R apply(XMLElement transformer, R output) throws XMLException;
|
|
|
-
|
|
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * Creates new XMLWriter associated with this element.
|
|
|
|
|
+ * Writer allows you to configure XML generator and serialize this element.
|
|
|
|
|
+ *
|
|
|
|
|
+ * For example, you can enable pretty printing for returned writer.
|
|
|
|
|
+ *
|
|
|
|
|
+ * @return XMLWriter
|
|
|
|
|
+ */
|
|
|
XMLWriter writer();
|
|
XMLWriter writer();
|
|
|
|
|
|
|
|
}
|
|
}
|