Package org.thymeleaf.dom

Examples of org.thymeleaf.dom.Node


     *
     * @see <a href="http://www.w3.org/TR/css3-selectors/#general-sibling-combinators">General sibling combinator</a>
     */
    private void addGeneralSiblingElements() {
        for (Node node : nodes) {
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                String tag = selector.getTagName();
                if (tagEquals(tag, DOMHelper.getNodeName(n)) || tag.equals(Selector.UNIVERSAL_TAG)) {
                    result.add(n);
                }
View Full Code Here


     * @see <a href="http://www.w3.org/TR/css3-selectors/#nth-child-pseudo"><code>:nth-child</code> pseudo-class</a>
     */
    private void addNthChild() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                count++;
                n = DOMHelper.getPreviousSiblingElement(n);
            }
           
View Full Code Here

     * @see <a href="http://www.w3.org/TR/css3-selectors/#nth-last-child-pseudo"><code>:nth-last-child</code> pseudo-class</a>
     */
    private void addNthLastChild() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                count++;
                n = DOMHelper.getNextSiblingElement(n);
            }
           
View Full Code Here

     * @see <a href="http://www.w3.org/TR/css3-selectors/#nth-of-type-pseudo"><code>:nth-of-type</code> pseudo-class</a>
     */
    private void addNthOfType() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    count++;
                }
               
View Full Code Here

     * @see <a href="http://www.w3.org/TR/css3-selectors/#nth-last-of-type-pseudo"><code>:nth-last-of-type</code> pseudo-class</a>
     */
    private void addNthLastOfType() {
        for (Node node : nodes) {
            int count = 1;
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    count++;
                }
               
View Full Code Here

     *
     * @see <a href="http://www.w3.org/TR/css3-selectors/#first-of-type-pseudo"><code>:first-of-type</code> pseudo-class</a>
     */
    private void addFirstOfType() {
        for (Node node : nodes) {
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
               
View Full Code Here

     *
     * @see <a href="http://www.w3.org/TR/css3-selectors/#last-of-type-pseudo"><code>:last-of-type</code> pseudo-class</a>
     */
    private void addLastOfType() {
        for (Node node : nodes) {
            Node n = DOMHelper.getNextSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
               
View Full Code Here

     *
     * @see <a href="http://www.w3.org/TR/css3-selectors/#only-of-type-pseudo"><code>:only-of-type</code> pseudo-class</a>
     */
    private void addOnlyOfTypeElements() {
        for (Node node : nodes) {
            Node n = DOMHelper.getPreviousSiblingElement(node);
            while (n != null) {
                if (DOMHelper.getNodeName(n).equals(DOMHelper.getNodeName(node))) {
                    break;
                }
               
View Full Code Here

      String trim = result.trim();
      Document dom = getXhtmlDOMFor(new StringReader(trim));

      Element firstChild = (Element) dom.getFirstChild();
      for (int i = 0; i < firstChild.getChildren().size(); i++) {
        Node next = firstChild.getChildren().get(i);
        if (i == 0 && firstChild.getChildren().size() == 1) {
          if (next instanceof org.thymeleaf.dom.Text) {
            org.thymeleaf.dom.Text nextText = (org.thymeleaf.dom.Text) next;
            nextText.setContent(nextText.getContent().trim());
          }
View Full Code Here

        super(attrName);
    }

    @Override
    protected List<Node> getModifiedChildren(Arguments arguments, Element element, String attributeName) {
        final Node newText = getTextNode(arguments, element, attributeName);
        List<Node> originalChildNodes = element.getChildren();
        List<Node> newNodes = removeRequiredTextNodes(originalChildNodes);
        addNewTextNodeToList(newNodes, newText);
        return newNodes;
    }
View Full Code Here

TOP

Related Classes of org.thymeleaf.dom.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.