Top Description Fields Constructors Methods
org.dom4j.rule

public Class Stylesheet

extends Object
Class Inheritance
Imports
java.util.List, org.dom4j.*

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.

Author
James Strachan
Version
$Revision: 1.14 $

Field Summary

Modifier and TypeField and Description
private String
modeName

Holds value of property mode.

private RuleManager

Constructor Summary

AccessConstructor and Description
public
Stylesheet()

Creates a new empty stylesheet.

Method Summary

Modifier and TypeMethod and Description
public void
addRule(Rule
the rule to add
rule
)

Add a rule to this stylesheet.

public void
applyTemplates(Object
the input object
input
,
XPath
the xpath expression
xpath
)

Processes the result of the xpath expression.

public void
applyTemplates(Object
the input object
input
,
XPath
the xpath expression
xpath
,
String
the mode
mode
)

Processes the result of the xpath expression in the given mode.

public void
applyTemplates(Node
the input object
node
)

If input is a Node, this will processes all of the children of that node.

public void
applyTemplates(Element
the input object
element
)

If input is a Node, this will processes all of the children of that node.

public void
applyTemplates(Document
the input object
document
)

If input is a Node, this will processes all of the children of that node.

public void
applyTemplates(List<Node>
the input object
list
)

If input is a Node, this will processes all of the children of that node.

public void
applyTemplates(Node
the input object
node
,
String
the mode
mode
)

Processes the input object in the given mode.

public void
applyTemplates(Element
the input object
element
,
String
the mode
mode
)

Processes the input object in the given mode.

public void
applyTemplates(Document
the input object
document
,
String
the mode
mode
)

Processes the input object in the given mode.

public void
applyTemplates(List<? extends Node>
list of Elements or Documents
list
,
String
the mode
mode
)

Processes the input object in the given mode.

public void
public String

Returns:

the name of the mode the stylesheet uses by default
getModeName
()

DOCUMENT ME!

public Action

Returns:

the default value-of action which is used in the default rules for the pattern "text()|@"
getValueOfAction
()

DOCUMENT ME!

public void
removeRule(Rule
the rule to remove
rule
)

Removes the specified rule from this stylesheet.

public void
run(List<Node> list)

public void
run(List<Node> list, String mode)

public void
run(Node node)

public void
run(Node node, String mode)

public void
setModeName(String
DOCUMENT ME!
modeName
)

Sets the name of the mode that the stylesheet uses by default.

public void
setValueOfAction(Action
DOCUMENT ME!
valueOfAction
)

Sets the default value-of action which is used in the default rules for the pattern "text()|@"

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

modeNameback to summary
private String modeName

Holds value of property mode.

ruleManagerback to summary
private RuleManager ruleManager

Constructor Detail

Stylesheetback to summary
public Stylesheet()

Creates a new empty stylesheet.

Method Detail

addRuleback to summary
public void addRule(Rule rule)

Add a rule to this stylesheet.

Parameters
rule:Rule

the rule to add

applyTemplatesback to summary
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:Object

the input object

xpath:XPath

the xpath expression

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
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:Object

the input object

xpath:XPath

the xpath expression

mode:String

the mode

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Node node) 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
node:Node

the input object

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Element element) 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
element:Element

the input object

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Document document) 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
document:Document

the input object

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(List<Node> list) 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
list:List<Node>

the input object

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Node node, 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
node:Node

the input object

mode:String

the mode

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Element element, 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
element:Element

the input object

mode:String

the mode

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(Document document, 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
document:Document

the input object

mode:String

the mode

Exceptions
Exception:
if something goes wrong
applyTemplatesback to summary
public void applyTemplates(List<? extends Node> list, 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
list:List<? extends Node>

list of Elements or Documents

mode:String

the mode

Exceptions
Exception:
if something goes wrong
clearback to summary
public void clear()
getModeNameback to summary
public String getModeName()

DOCUMENT ME!

Returns:String

the name of the mode the stylesheet uses by default

getValueOfActionback to summary
public Action getValueOfAction()

DOCUMENT ME!

Returns:Action

the default value-of action which is used in the default rules for the pattern "text()|@"

removeRuleback to summary
public void removeRule(Rule rule)

Removes the specified rule from this stylesheet.

Parameters
rule:Rule

the rule to remove

runback to summary
public void run(List<Node> list) throws Exception
runback to summary
public void run(List<Node> list, String mode) throws Exception
runback to summary
public void run(Node node) throws Exception
runback to summary
public void run(Node node, String mode) throws Exception
setModeNameback to summary
public void setModeName(String modeName)

Sets the name of the mode that the stylesheet uses by default.

Parameters
modeName:String

DOCUMENT ME!

setValueOfActionback to summary
public void setValueOfAction(Action valueOfAction)

Sets the default value-of action which is used in the default rules for the pattern "text()|@"

Parameters
valueOfAction:Action

DOCUMENT ME!