org.thymeleaf.dom
Class DOMSelector
Object
org.thymeleaf.dom.DOMSelector
- All Implemented Interfaces:
- java.io.Serializable
public final class DOMSelector
- extends Object
- implements java.io.Serializable
DOM Selectors model selections of subtrees from Thymeleaf DOM trees.
A common use of these selectors is for including fragments of other templates
without the need of these other templates having any Thymeleaf code.
DOM Selector syntax is a subset of XPath, including:
- /x means direct children of the current node with name x.
- //x means children of the current node with name x, at any depth.
- x[@z="v"] means elements with name x and an attribute called z with
value "v".
- x[@z1="v1" and @z2="v2"] means elements with name x and attributes
z1 and z2 with values "v1" and "v2", respectively.
- x[i] means element with name x positioned in number i among
its siblings.
- x[@z="v"][i] means elements with name x, attribute z with
value "v" and positioned in number i among its siblings that also match this
condition.
For example: //div[@id="menu"].
- Since:
- 2.0.0
- Author:
- Daniel Fernández
- See Also:
- Serialized Form
Methods inherited from class Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
DOMSelector
public DOMSelector(String selectorSpec)
select
public java.util.List<Node> select(java.util.List<Node> nodes)
toString
public final String toString()
- Overrides:
toString
in class Object
Copyright © 2012 The THYMELEAF team. All Rights Reserved.