org.dom4j.rule

Class Stylesheet


public class Stylesheet
extends java.lang.Object

Stylesheet implements an XSLT stylesheet such that rules can be added to the stylesheet and the stylesheet can be applied to a source document or node.
Version:
$Revision: 1.14 $
Author:
James Strachan

Constructor Summary

Stylesheet()
Creates a new empty stylesheet.

Method Summary

void
addRule(Rule rule)
Add a rule to this stylesheet.
void
applyTemplates(Object input)
If input is a Node, this will processes all of the children of that node.
void
applyTemplates(Object input, String mode)
Processes the input object in the given mode.
void
applyTemplates(Object input, XPath xpath)
Processes the result of the xpath expression.
void
applyTemplates(Object input, XPath xpath, String mode)
Processes the result of the xpath expression in the given mode.
void
applyTemplates(Object input, org.jaxen.XPath xpath)
Deprecated. Use applyTemplates(Object,XPath)instead.
void
applyTemplates(Object input, org.jaxen.XPath xpath, String mode)
Deprecated. Use applyTemplates(Object,XPath,String) instead.
void
clear()
String
getModeName()
DOCUMENT ME!
Action
getValueOfAction()
DOCUMENT ME!
void
removeRule(Rule rule)
Removes the specified rule from this stylesheet.
void
run(List list)
void
run(List list, String mode)
void
run(Object input)
Runs this stylesheet on the given input which should be either a Node or a List of Node objects.
void
run(Object input, String mode)
void
run(Node node)
void
run(Node node, String mode)
void
setModeName(String modeName)
Sets the name of the mode that the stylesheet uses by default.
void
setValueOfAction(Action valueOfAction)
Sets the default value-of action which is used in the default rules for the pattern "text()|@"

Constructor Details

Stylesheet

public Stylesheet()
Creates a new empty stylesheet.

Method Details

addRule

public void addRule(Rule rule)
Add a rule to this stylesheet.
Parameters:
rule - the rule to add

applyTemplates

public void applyTemplates(Object input)
            throws Exception
If input is a Node, this will processes all of the children of that node. If input is a List of Nodess, these nodes will be iterated and all children of each node will be processed.
Parameters:
input - the input object, this can either be a Node or a List

applyTemplates

public void applyTemplates(Object input,
                           String mode)
            throws Exception
Processes the input object in the given mode. If input is a Node, this will processes all of the children of that node. If input is a List of Nodess, these nodes will be iterated and all children of each node will be processed.
Parameters:
input - the input object, this can either be a Node or a List
mode - the mode

applyTemplates

public void applyTemplates(Object input,
                           XPath xpath)
            throws Exception
Processes the result of the xpath expression. The xpath expression is evaluated against the provided input object.
Parameters:
input - the input object
xpath - the xpath expression

applyTemplates

public void applyTemplates(Object input,
                           XPath xpath,
                           String mode)
            throws Exception
Processes the result of the xpath expression in the given mode. The xpath expression is evaluated against the provided input object.
Parameters:
input - the input object
xpath - the xpath expression
mode - the mode

applyTemplates

public void applyTemplates(Object input,
                           org.jaxen.XPath xpath)
            throws Exception

Deprecated. Use applyTemplates(Object,XPath)instead.

Processes the result of the xpath expression. The xpath expression is evaluated against the provided input object.
Parameters:
input - the input object
xpath - the xpath expression

applyTemplates

public void applyTemplates(Object input,
                           org.jaxen.XPath xpath,
                           String mode)
            throws Exception

Deprecated. Use applyTemplates(Object,XPath,String) instead.

Processes the result of the xpath expression in the given mode. The xpath expression is evaluated against the provided input object.
Parameters:
input - the input object
xpath - the xpath expression
mode - the mode

clear

public void clear()

getModeName

public String getModeName()
DOCUMENT ME!
Returns:
the name of the mode the stylesheet uses by default

getValueOfAction

public Action getValueOfAction()
DOCUMENT ME!
Returns:
the default value-of action which is used in the default rules for the pattern "text()|@"

removeRule

public void removeRule(Rule rule)
Removes the specified rule from this stylesheet.
Parameters:
rule - the rule to remove

run

public void run(List list)
            throws Exception

run

public void run(List list,
                String mode)
            throws Exception

run

public void run(Object input)
            throws Exception
Runs this stylesheet on the given input which should be either a Node or a List of Node objects.
Parameters:
input - the input to run this stylesheet on

run

public void run(Object input,
                String mode)
            throws Exception

run

public void run(Node node)
            throws Exception

run

public void run(Node node,
                String mode)
            throws Exception

setModeName

public void setModeName(String modeName)
Sets the name of the mode that the stylesheet uses by default.
Parameters:
modeName - DOCUMENT ME!

setValueOfAction

public void setValueOfAction(Action valueOfAction)
Sets the default value-of action which is used in the default rules for the pattern "text()|@"
Parameters:
valueOfAction - DOCUMENT ME!

Copyright B) 2005 MetaStuff Ltd. All Rights Reserved. Hosted by

SourceForge Logo