Package org.dom4j.rule
Class Stylesheet
- java.lang.Object
-
- org.dom4j.rule.Stylesheet
-
public class Stylesheet extends java.lang.ObjectStylesheetimplements 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
Constructors Constructor Description Stylesheet()Creates a new empty stylesheet.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidaddRule(Rule rule)Add a rule to this stylesheet.voidapplyTemplates(java.lang.Object input)If input is aNode, this will processes all of the children of that node.voidapplyTemplates(java.lang.Object input, java.lang.String mode)Processes the input object in the given mode.voidapplyTemplates(java.lang.Object input, XPath xpath)Processes the result of the xpath expression.voidapplyTemplates(java.lang.Object input, XPath xpath, java.lang.String mode)Processes the result of the xpath expression in the given mode.voidapplyTemplates(java.lang.Object input, org.jaxen.XPath xpath)Deprecated.UseapplyTemplates(Object, XPath)instead.voidapplyTemplates(java.lang.Object input, org.jaxen.XPath xpath, java.lang.String mode)Deprecated.UseapplyTemplates(Object, XPath, String)instead.voidclear()java.lang.StringgetModeName()DOCUMENT ME!ActiongetValueOfAction()DOCUMENT ME!voidremoveRule(Rule rule)Removes the specified rule from this stylesheet.voidrun(java.lang.Object input)Runs this stylesheet on the given input which should be either a Node or a List of Node objects.voidrun(java.lang.Object input, java.lang.String mode)voidrun(java.util.List list)voidrun(java.util.List list, java.lang.String mode)voidrun(Node node)voidrun(Node node, java.lang.String mode)voidsetModeName(java.lang.String modeName)Sets the name of the mode that the stylesheet uses by default.voidsetValueOfAction(Action valueOfAction)Sets the default value-of action which is used in the default rules for the pattern "text()|@"
-
-
-
Method Detail
-
addRule
public void addRule(Rule rule)
Add a rule to this stylesheet.- Parameters:
rule- the rule to add
-
removeRule
public void removeRule(Rule rule)
Removes the specified rule from this stylesheet.- Parameters:
rule- the rule to remove
-
run
public void run(java.lang.Object input) throws java.lang.ExceptionRuns 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- Throws:
java.lang.Exception- if something goes wrong
-
run
public void run(java.lang.Object input, java.lang.String mode) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public void run(java.util.List list) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public void run(java.util.List list, java.lang.String mode) throws java.lang.Exception- Throws:
java.lang.Exception
-
run
public void run(Node node) throws java.lang.Exception
- Throws:
java.lang.Exception
-
run
public void run(Node node, java.lang.String mode) throws java.lang.Exception
- Throws:
java.lang.Exception
-
applyTemplates
public void applyTemplates(java.lang.Object input, XPath xpath) throws java.lang.ExceptionProcesses the result of the xpath expression. The xpath expression is evaluated against the provided input object.- Parameters:
input- the input objectxpath- the xpath expression- Throws:
java.lang.Exception- if something goes wrong
-
applyTemplates
public void applyTemplates(java.lang.Object input, XPath xpath, java.lang.String mode) throws java.lang.ExceptionProcesses the result of the xpath expression in the given mode. The xpath expression is evaluated against the provided input object.- Parameters:
input- the input objectxpath- the xpath expressionmode- the mode- Throws:
java.lang.Exception- if something goes wrong
-
applyTemplates
public void applyTemplates(java.lang.Object input, org.jaxen.XPath xpath) throws java.lang.ExceptionDeprecated.UseapplyTemplates(Object, XPath)instead.Processes the result of the xpath expression. The xpath expression is evaluated against the provided input object.- Parameters:
input- the input objectxpath- the xpath expression- Throws:
java.lang.Exception- if something goes wrong
-
applyTemplates
public void applyTemplates(java.lang.Object input, org.jaxen.XPath xpath, java.lang.String mode) throws java.lang.ExceptionDeprecated.UseapplyTemplates(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 objectxpath- the xpath expressionmode- the mode- Throws:
java.lang.Exception- if something goes wrong
-
applyTemplates
public void applyTemplates(java.lang.Object input) throws java.lang.ExceptionIf input is aNode, this will processes all of the children of that node. If input is aListofNodess, these nodes will be iterated and all children of each node will be processed.- Parameters:
input- the input object, this can either be aNodeor aList- Throws:
java.lang.Exception- if something goes wrong
-
applyTemplates
public void applyTemplates(java.lang.Object input, java.lang.String mode) throws java.lang.ExceptionProcesses the input object in the given mode. If input is aNode, this will processes all of the children of that node. If input is aListofNodess, these nodes will be iterated and all children of each node will be processed.- Parameters:
input- the input object, this can either be aNodeor aListmode- the mode- Throws:
java.lang.Exception- if something goes wrong
-
clear
public void clear()
-
getModeName
public java.lang.String getModeName()
DOCUMENT ME!- Returns:
- the name of the mode the stylesheet uses by default
-
setModeName
public void setModeName(java.lang.String modeName)
Sets the name of the mode that the stylesheet uses by default.- Parameters:
modeName- DOCUMENT ME!
-
getValueOfAction
public Action getValueOfAction()
DOCUMENT ME!- Returns:
- the default value-of action which is used in the default rules for the pattern "text()|@"
-
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!
-
-