Package com.colorfulsoftware.atom

Examples of com.colorfulsoftware.atom.FeedDoc$ProcessingInstruction


  }

  @Test
  public void testOutputProcessingInstructionData() {
    String pi = "  hello   there  ";
    ProcessingInstruction inpi = new ProcessingInstruction("jdomtest", pi);
    String outpi = "<?jdomtest " + pi + "?>";
    checkOutput(inpi, outpi, outpi, outpi, outpi, outpi);
  }
View Full Code Here


    root.addContent(new Text(" "));
    root.addContent(new Comment("Boo"));
    root.addContent(new Text(" "));
    root.addContent(new Element("child"));
    root.addContent(new Text(" "));
    root.addContent(new ProcessingInstruction("pitarget"));
    root.addContent(new Text(" "));
    checkOutput(root, 
        "<root> <!--Boo--> <child /> <?pitarget?> </root>",
        "<root><!--Boo--><child /><?pitarget?></root>",
        "<root>\n  <!--Boo-->\n  <child />\n  <?pitarget?>\n</root>",
View Full Code Here

  @Test
  public void testOutputDocumentFull() {
    DocType dt = new DocType("root");
    Comment comment = new Comment("comment");
    ProcessingInstruction pi = new ProcessingInstruction("jdomtest", "");
    Element root = new Element("root");
    Document doc = new Document();
    doc.addContent(dt);
    doc.addContent(comment);
    doc.addContent(pi);
View Full Code Here

      Document doc = new Document();
      DocType dt = new DocType("root");
      dt.setInternalSubset(" ");
      doc.addContent(dt);
      doc.addContent(new Comment("This is a document"));
      doc.addContent(new ProcessingInstruction("jdomtest", ""));
      Element e = new Element("root");
      e.addContent(new EntityRef("ref"));
      doc.addContent(e);
      roundTripDocument(doc);
    }
View Full Code Here

    }
   
  @Test
  public void testRTOutputList() {
    List<Content> list = new ArrayList<Content>();
    list.add(new ProcessingInstruction("jdomtest", ""));
    list.add(new Comment("comment"));
    list.add(new Element("root"));
    roundTripFragment(list);
  }
View Full Code Here

  @Test
  @Ignore
  // TODO
  public void testOutputFragmentList() {
    List<Content> list = new ArrayList<Content>();
    list.add(new ProcessingInstruction("jdomtest", ""));
    list.add(new Comment("comment"));
    list.add(new CDATA("foo"));
    list.add(new Element("root"));
    list.add(new Text("bar"));
    roundTripFragment(list);
View Full Code Here

  @Test
  @Ignore
  // TODO
  public void testOutputFragmentContent() {
    roundTripFragment(new ProcessingInstruction("jdomtest", ""));
    roundTripFragment(new Comment("comment"));
    roundTripFragment(new CDATA("foo"));
    roundTripFragment(new Element("root"));
    roundTripFragment(new Text("bar"));
  }
View Full Code Here

            break;
          case EntityRef:
            assertEquals(((EntityRef)a).getName(), ((EntityRef)b).getName());
            break;
          case ProcessingInstruction:
            ProcessingInstruction pa = (ProcessingInstruction)a;
            ProcessingInstruction pb = (ProcessingInstruction)b;
            assertEquals(pa.getTarget(), pb.getTarget());
            assertEquals(pa.getData(), pb.getData());
            break;
        }
      } else if (ap instanceof Attribute) {
        compare ((Attribute)ap, (Attribute)bp);
      } else if (ap instanceof Document) {
View Full Code Here

 
  @Test
  public void testOutputElementIgnoreTrAXEscapingPIs() {
    Element root = new Element("root");
    root.addContent(new Text("&"));
    root.addContent(new ProcessingInstruction(Result.PI_DISABLE_OUTPUT_ESCAPING, ""));
    root.addContent(new Text(" && "));
    root.addContent(new ProcessingInstruction(Result.PI_ENABLE_OUTPUT_ESCAPING, ""));
    root.addContent(new Text("&"));
    String expect = "<root>&amp; && &amp;</root>";
    String excompact = "<root>&amp;&&&amp;</root>";
    String expretty = "<root>\n  &amp;\n  \n  &&\n  \n  &amp;\n</root>";
    String extfw = "<root>\n  &amp;\n  \n   && \n  \n  &amp;\n</root>";
View Full Code Here

          }
        } else if (event.isEntityReference()) {
          current.addContent(factory.entityRef(
              ((javax.xml.stream.events.EntityReference)event).getName()));
        } else if (event.isProcessingInstruction()) {
          final ProcessingInstruction pi = factory.processingInstruction(
              ((javax.xml.stream.events.ProcessingInstruction)event).getTarget(),
              ((javax.xml.stream.events.ProcessingInstruction)event).getData());
          if (current == null) {
            document.addContent(pi);
          } else {
View Full Code Here

TOP

Related Classes of com.colorfulsoftware.atom.FeedDoc$ProcessingInstruction

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.