Taak scripts may invoke user defined functions or user-defined functions.
Taak has built-in functions for manipulating strings, lists, and JDOM
objects.
A Taak script may redirect or forward a request to another URL using
the redirect or forward functions.
| Function |
Description |
Examples |
| getRootElement |
Returns the root element of a document. |
getRootElement(DOCUMENT); |
| getElementById |
Returns a descendant element with the specified id. The first argument
may be a document or an element. |
getElementById(DOCUMENT, "x");
getElementById(ele, "x"); |
| getElementByName |
Returns the first descendant element if textual order with the specified
tag name. |
getElementByName(DOCUMENT, "x"); |
| getElementByIndex |
Returns the nth child indexed from 0 of an element. |
getElementByIndex(e, 0); |
| getParent |
Returns the parent element. |
getParent(e); |
| cloneElement |
Return a deep clone of an element but do not attach the clone to
the parent of the original. |
cloneElement(e); |
| copyElement |
Return a deep clone of an element and add it to the parent of the
original. |
copyElement(e); |
| removeElement |
Remove an element and all its descendants. |
removeElement(e); |
| removeChildren |
Remove all descendants of an element. |
removeChildren(e); |
| getText |
Returns the text of an element. |
getText(e); |
| setText |
Set the text of an element. |
setText(e, "foobar"); |
| getAttribute |
Returns the attribute value of an element. |
getAttribute(e, "href"); |
| setAttribute |
Sets the attribute value of an element. |
setAttribute(e, "href", "foo.htm"); |
| removeAttribute |
Remove the attribute of an element. |
domRemoveAttribute(e, "href"); |
| removeIds |
Remove all id attributes from an element and its descendants. |
domRemoveIds(e); |