java.lang.Object
org.websody.xslt.Extensions
- public class Extensions
- extends java.lang.Object
This class contains several useful XSLT extension elements and functions.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
log
private static org.apache.log4j.Category log
Extensions
public Extensions()
test
public static java.lang.Object test(boolean condition,
java.lang.Object a,
java.lang.Object b)
- Returns either object
a or b depending
on the condition.
resolve
public static java.lang.String resolve(java.lang.String href,
java.lang.String base)
- If
href starts with a slash, href is returned.
Otherwise href will be prefixed with base.
If base is a file rather than a directory the file's parent
directory is used.
dia2ImageMap
public static java.lang.String dia2ImageMap(java.lang.String rect,
int scale)
- This function converts dia object boundaries to html imagemap
coordinates.
stripDiaHashes
public static java.lang.String stripDiaHashes(java.lang.String s)
- This function strips the first and last character of a given String.
This is useful when processing dia files because dia encloses its
Strings with hashes ('#').
wikiList
public static org.w3c.dom.Element wikiList(java.lang.String s)
throws javax.xml.transform.TransformerException,
javax.xml.parsers.ParserConfigurationException
- This function converts a wiki list ('*' in front of each item) into
a html unordered list.
img
public org.w3c.dom.Element img(org.apache.xalan.extensions.XSLProcessorContext context,
org.apache.xalan.templates.ElemExtensionCall extElem)
throws org.websody.WebsodyException,
javax.xml.transform.TransformerException,
javax.xml.parsers.ParserConfigurationException,
java.io.FileNotFoundException
- This extension element can be used as replacment for the html img tag.
The attributes width and height can be set to
auto in which
case the extension tries to determine the correct size. If it fails
(due to an unsupported format for example) the attributes are omitted.
Important: The transformer must have a URIResolver that resolves the
src attribute to a path in the filesystem.
copyElement
private org.w3c.dom.Element copyElement(org.apache.xalan.extensions.XSLProcessorContext context,
org.apache.xalan.templates.ElemExtensionCall extElem)
throws javax.xml.transform.TransformerException,
javax.xml.parsers.ParserConfigurationException
- Creates a shallow copy of the extension element. The namespace is ommited
and all attribute value templates are evaluated.