Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.websody.xslt
Class Extensions  view Extensions download Extensions.java

java.lang.Object
  extended byorg.websody.xslt.Extensions

public class Extensions
extends java.lang.Object

This class contains several useful XSLT extension elements and functions.


Field Summary
private static org.apache.log4j.Category log
           
 
Constructor Summary
Extensions()
           
 
Method Summary
private  org.w3c.dom.Element copyElement(org.apache.xalan.extensions.XSLProcessorContext context, org.apache.xalan.templates.ElemExtensionCall extElem)
          Creates a shallow copy of the extension element.
static java.lang.String dia2ImageMap(java.lang.String rect, int scale)
          This function converts dia object boundaries to html imagemap coordinates.
 org.w3c.dom.Element img(org.apache.xalan.extensions.XSLProcessorContext context, org.apache.xalan.templates.ElemExtensionCall extElem)
          This extension element can be used as replacment for the html img tag.
static java.lang.String resolve(java.lang.String href, java.lang.String base)
          If href starts with a slash, href is returned.
static java.lang.String stripDiaHashes(java.lang.String s)
          This function strips the first and last character of a given String.
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.
static org.w3c.dom.Element wikiList(java.lang.String s)
          This function converts a wiki list ('*' in front of each item) into a html unordered list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static org.apache.log4j.Category log
Constructor Detail

Extensions

public Extensions()
Method Detail

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.