Package org.exoplatform.services.html

Examples of org.exoplatform.services.html.HTMLNode.addChild()


      assertNotNull(node);
      assertEquals(node.getName(), Name.TITLE);

      //Add a Tag to HTMLDocument.
      NodeImpl impl = new NodeImpl("h2 id = \"dds\"".toCharArray(), Name.H2);
      node.addChild(impl);
      assertNotNull(node.getChildrenNode().get(1));
      assertEquals(node.getChildren().get(1).getName(), Name.H2);
      System.out.println("THE NEW NODE-NAME: " + node.getChildrenNode().get(1).getName().toString());
      System.out.println("THE NEW NODE-VALUE: " + new String(node.getChildren().get(1).getValue()));
View Full Code Here


      //Pass the Node which has removed from HTMLDocument into the <h2> TAG.
      HTMLNode h2Node = NodePathUtil.lookFor(document.getRoot(), NodePathParser.toPath("html.head.title.h2"));
      assertNotNull(h2Node);
      assertEquals(Name.H2, h2Node.getName());
      assertEquals("H2", h2Node.getName().toString());
      h2Node.addChild(contentNode);

      //Show all.
      System.out.println("\n\nShow all the content of HTML file:");
      System.out.println(node.getTextValue());
   }
View Full Code Here

      if (header == null || !header.isNode(Name.HEAD))
      {
         header = ParserService.createHeader();
      }
      node.getParent().getChildren().remove(node);
      header.addChild(node);
      node.setParent(header);
   }

   private void insert(HTMLNode node, HTMLNode element)
   {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.