Class Stylesheet
java.lang.Object
org.dom4j.rule.Stylesheet
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 $
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
Holds value of property mode.private RuleManager
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Add a rule to this stylesheet.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
(List<? extends Node> list, String mode) Processes the input object in the given mode.void
applyTemplates
(List<Node> list) If input is aNode
, this will processes all of the children of that node.void
applyTemplates
(Document document) If input is aNode
, this will processes all of the children of that node.void
applyTemplates
(Document document, String mode) Processes the input object in the given mode.void
applyTemplates
(Element element) If input is aNode
, this will processes all of the children of that node.void
applyTemplates
(Element element, String mode) Processes the input object in the given mode.void
applyTemplates
(Node node) If input is aNode
, this will processes all of the children of that node.void
applyTemplates
(Node node, String mode) Processes the input object in the given mode.void
clear()
DOCUMENT ME!DOCUMENT ME!void
removeRule
(Rule rule) Removes the specified rule from this stylesheet.void
void
void
void
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()|@"
-
Field Details
-
ruleManager
-
modeName
Holds value of property mode.
-
-
Constructor Details
-
Stylesheet
public Stylesheet()Creates a new empty stylesheet.
-
-
Method Details
-
addRule
-
removeRule
Removes the specified rule from this stylesheet.- Parameters:
rule
- the rule to remove
-
run
-
run
-
run
-
run
-
applyTemplates
-
applyTemplates
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:
Exception
- if something goes wrong
-
applyTemplates
If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
node
- the input object- Throws:
Exception
- if something goes wrong
-
applyTemplates
If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
element
- the input object- Throws:
Exception
- if something goes wrong
-
applyTemplates
If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
document
- the input object- Throws:
Exception
- if something goes wrong
-
applyTemplates
If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
list
- the input object- Throws:
Exception
- if something goes wrong
-
applyTemplates
Processes the input object in the given mode. If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
node
- the input objectmode
- the mode- Throws:
Exception
- if something goes wrong
-
applyTemplates
Processes the input object in the given mode. If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
element
- the input objectmode
- the mode- Throws:
Exception
- if something goes wrong
-
applyTemplates
Processes the input object in the given mode. If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
document
- the input objectmode
- the mode- Throws:
Exception
- if something goes wrong
-
applyTemplates
Processes the input object in the given mode. If input is aNode
, this will processes all of the children of that node. If input is aList
ofNodes
s, these nodes will be iterated and all children of each node will be processed.- Parameters:
list
- list of Elements or Documentsmode
- the mode- Throws:
Exception
- if something goes wrong
-
clear
public void clear() -
getModeName
DOCUMENT ME!- Returns:
- the name of the mode the stylesheet uses by default
-
setModeName
Sets the name of the mode that the stylesheet uses by default.- Parameters:
modeName
- DOCUMENT ME!
-
getValueOfAction
DOCUMENT ME!- Returns:
- the default value-of action which is used in the default rules for the pattern "text()|@"
-
setValueOfAction
Sets the default value-of action which is used in the default rules for the pattern "text()|@"- Parameters:
valueOfAction
- DOCUMENT ME!
-