XPath functions

These are xpath extension functions in the Tinderbox namespace (use them prefixed by "tb:" in your xpaths.)

Functions that expect a node argument will always take the current node by default, enabling short forms such as

//item[tb:prototype()='X']

Also note, many functions that give notes from the Tinderbox document are mostly useful when called from within stylesheets, as those stylesheets generally do not operate on the Tinderbox document.

command-note()

Returns the note containing the command

current-text-position()

For XSL stylesheets:

Retrieves the number of text characters already in the note being constructed. Useful for expressing link anchors in terms of text positions.

error(msg?)

Generate an error message... Used in "xmlResult" to signal an error.

eval-script(scriptText, args...)

evaluate an arbitrary python function, given in the text.

That function will recieve the TinderboxDoc instance as first arguments, and then any other argument passed to the eval-script.

get-url(url)

Returns the text from a given URL.

links(fromNotes?,linkName?,direction?)

Given a set of nodes, give all the notes which are linked from them (or to them if direction evaluates to false.)

If linkName is specified, only the links of this type will be considered.

local-property(propName, notes?)

Evaluate the value of a named Tinderbox property on the current note. Will return a value only if the note defines this property locally. Compare property().

new-id()

Return an ID for a new Tinderbox node. This ID does not exist in the document, and will not be used again.

note-by-id(ids)

Return a (list of) Tinderbox note items given a (list of) numeric ID.

note-from-alias(aliases?)

given an alias note, return the underlying note.

note-in-construction()

For use in XSL stylesheets:

Returns the note being constructed. Useful for declaring a link on an existing note.

property(propName, notes?)

Evaluate the value of a named Tinderbox property on the current note. If the value is not defined for that note, will go up the prototype chain to look for the value, and if it is not found, it will return the default for that property.

prototype(note?)

From a (list of) note, retrieve the name of its prototype. (I use the name to conform to the way Tinderbox handles Prototype, somewhat as a property.)

prototype-by-name(name)

Returns the prototype note that has a given name, if any.

result-of(command note)

This retrieves the result of the command note passed as a parameter.

It is mostly useful in combination with commands that create notes, but it will also retrieve a value from an Eval command.

It is also used to retrieve the value of the iteration variable in a ForEach

root-note()

Returns the root note of the Tinderbox document.

target-note()

Returns the note which is the target of the current command. Allows to anchor XPaths for search.

Last modified on 20/05/04. Created by Marc-Antoine Parent with Tinderbox 3.0.4.