Package nu.xom

Examples of nu.xom.NodeFactory


   
    public void testCanReplaceRootElementFromFinishMakingElement()
      throws ParsingException, IOException {
       
        String data = "<root/>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(new Element("newroot"));
View Full Code Here


   
    public void testCanAddAroundExistingRootElementFromFinishMakingElement()
      throws ParsingException, IOException {
       
        String data = "<root/>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(element);
View Full Code Here

   
    public void testCantReplaceRootElementWithNoElement()
      throws ParsingException, IOException {
       
        String data = "<root/>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Comment("test"));
                result.append(new ProcessingInstruction("test", "test"));
View Full Code Here

   
    public void testCantReplaceRootElementWithNothing()
      throws ParsingException, IOException {
       
        String data = "<root/>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                return new Nodes();  
            }
           
View Full Code Here

   
    public void testReplaceCommentWithAttribute()
      throws ParsingException, IOException {
       
        String data = "<root><!--comment--></root>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes makeComment(String data) {
                return new Nodes(new Attribute("name", "value"));  
            }
           
View Full Code Here

   
    public void testReplaceProcessingInstructionWithAttribute()
      throws ParsingException, IOException {
       
        String data = "<root><?target data?></root>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes makeProcessingInstruction(String target, String data) {
                return new Nodes(new Attribute("name", "value"));  
            }
           
View Full Code Here

   
    public void testReplaceProcessingInstructionWithText()
      throws ParsingException, IOException {
       
        String data = "<root><?target data?></root>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes makeProcessingInstruction(String target, String data) {
                return new Nodes(new Text(data));  
            }
           
View Full Code Here

   
    public void testCantReplaceRootElementWithTwoElements()
      throws ParsingException, IOException {
       
        String data = "<root/>";  
        Builder builder = new Builder(new NodeFactory() {
           
            public Nodes finishMakingElement(Element element) {
                Nodes result = new Nodes();
                result.append(new Element("first"));
                result.append(new Element("second"));
View Full Code Here

   
    public void testOrderOfCalls()
      throws ParsingException, IOException {
       
        String data = "<root>1<child>2</child>3</root>";
        Builder builder = new Builder(new NodeFactory() {
           
            String s = "";
           
            public Nodes makeText(String text) {
                s += text;
View Full Code Here

   
    public void testOrderOfCallsWithPI()
      throws ParsingException, IOException {
       
        String data = "<root>1<?data ?>2</root>";
        Builder builder = new Builder(new NodeFactory() {
           
            String s = "";
           
            public Nodes makeText(String text) {
                s += text;
View Full Code Here

TOP

Related Classes of nu.xom.NodeFactory

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.