APISonar


com.google.caja.reporting.MarkupRenderMode.XML

> com > google > caja > reporting > MarkupRenderMode > XML
com APIs google APIs caja APIs reporting APIs MarkupRenderMode APIs XML APIs

Example 1
public final void testIECommentsWithCdataPreservedInUnsafeMode()
      throws Exception {
    Node el = parse(IE_COMMENTS_WITH_CDATA_TEST_XML, false, true);
    assertRendersUnsafe(IE_COMMENTS_WITH_CDATA_TEST_XML,
                        el, MarkupRenderMode.HTML);
    el = parse(IE_COMMENTS_WITH_CDATA_TEST_XML, true, true);
    assertRendersUnsafe(IE_COMMENTS_WITH_CDATA_TEST_XML,
                        el, MarkupRenderMode.XML);
  }
Example 2
public void formatSelf(MessageContext context, int depth, Appendable out)
      throws IOException {
    out.append(this.getClass().getSimpleName()).append(" : ");
    String html = Nodes.render(fragment, MarkupRenderMode.XML)
        .replace("\\", "\\\\").replace("\n", "\\n").replace("\r", "\\r");
    out.append(html);
  }
Example 3
Renderer(
      RenderContext rc, StringBuilder out, MarkupRenderMode mode,
      Namespaces ns) {
    this.rc = rc;
    this.out = out;
    this.mode = mode;
    this.asXml = mode == MarkupRenderMode.XML;
    this.namespaceDepthAtStart = depth(ns);
  }
Example 4
public final void testCommentsHidingCdataEnd() throws Exception {
    DocumentFragment t = xmlFragment(
        fromString("<xmp> <!-- </xmp> --> </xmp>"));
    assertEquals("<xmp>  </xmp>", Nodes.render(t, MarkupRenderMode.XML));
    assertEquals("<xmp>  </xmp>", Nodes.render(t, MarkupRenderMode.HTML));
  }
Example 5
public final void testRenderModes() throws Exception {
    DocumentFragment f = htmlFragment(fromString(
        "<input checked name=foo type=checkbox>"));
    assertEquals(
        "<input checked=\"\" name=\"foo\" type=\"checkbox\" />",
        Nodes.render(f, MarkupRenderMode.XML));
    assertEquals(
        "<input checked=\"\" name=\"foo\" type=\"checkbox\" />",
        Nodes.render(f, MarkupRenderMode.HTML));
    assertEquals(
        "<input checked name=\"foo\" type=\"checkbox\" />",
        Nodes.render(f, MarkupRenderMode.HTML4_BACKWARDS_COMPAT));
  }
Example 6
public final void testProcessingInstructions() {
    Document doc = DomParser.makeDocument(null, null);
    ProcessingInstruction pi = doc.createProcessingInstruction("foo", "bar");
    assertEquals("<?foo bar?>", Nodes.render(pi, MarkupRenderMode.XML));
  }
Example 7
public final void testCommentsRemoved() throws Exception {
    Node el = parse(TEST_XML, false, false);
    assertEquals(RENDER_NO_COMMENTS, Nodes.render(el, MarkupRenderMode.HTML));
    el = parse(TEST_XML, true, false);
    assertEquals(RENDER_NO_COMMENTS, Nodes.render(el, MarkupRenderMode.XML));
    el = parse(IE_NESTED_CONDITIONAL_COMMENTS_TEST_XML, false, false);
    assertEquals(RENDER_NO_NESTED_COMMENTS,
            Nodes.render(el, MarkupRenderMode.HTML));
    el = parse(IE_NESTED_CONDITIONAL_COMMENTS2_TEST_XML, false, false);
    assertEquals(RENDER_NO_NESTED_COMMENTS,
            Nodes.render(el, MarkupRenderMode.HTML));
  }
Example 8
private void precise(Node tree) {
    preciseOutput(Nodes.render(tree));
    preciseOutput(Nodes.render(tree, MarkupRenderMode.HTML));
    preciseOutput(Nodes.render(tree, MarkupRenderMode.XML));
    // We're only making this guarantee for the common render options.
  }