Examples of HTMLSchema


Examples of com.google.caja.lang.html.HtmlSchema

            "resource:///com/google/caja/lang/css/css-extensions-fns.json"),
            mq));
  }

  public HtmlSchema getHtmlSchema(MessageQueue mq) {
    return new HtmlSchema(
        whitelist(htmlElementWhitelistUri, mq),
        whitelist(htmlAttributeWhitelistUri, mq));
  }
View Full Code Here

Examples of com.google.caja.lang.html.HtmlSchema

  }

  @Override
  protected boolean runPipeline(Jobs jobs) throws Exception {
    mq.getMessages().clear();
    HtmlSchema schema = HtmlSchema.getDefault(mq);
    return new ResolveUriStage(schema).apply(jobs)
        && new RewriteHtmlStage(schema, new StubJobCache()).apply(jobs);
  }
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

        // Expect no anchor text
        assertEquals("", linkContentHandler.getLinks().get(0).getText());

        // We'll change the schema to allow tables inside anchors!
        Schema schema = new HTMLSchema();
        schema.elementType("a", HTMLSchema.M_ANY, 65535, 0);

        ParseContext parseContext = new ParseContext();
        parseContext.set(Schema.class, schema);
        linkContentHandler = new LinkContentHandler();
        new HtmlParser().parse (
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    /**
     * @return the htmlSchema
     */
    public Schema getParsingSchema() {
        if (parsingSchema == null) {
            this.parsingSchema = new HTMLSchema();
        }
        return parsingSchema;
    }
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    try {
      String xhtml = XHTML_START + badHTMLSnippet + XHTML_END;
      bytes = xhtml.getBytes("UTF-8");
      InputStream in = new ByteArrayInputStream(bytes);
      Parser parser = new Parser();
      HTMLSchema schema = new HTMLSchema();
      parser.setProperty(Parser.schemaProperty, schema);
      Writer w = new StringWriter();
      XMLWriter x = new XMLWriter(w);
      x.setOutputProperty(XMLWriter.METHOD, "xml");
      x.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes");
      x.setPrefix(schema.getURI(), "");

      parser.setFeature(Parser.namespacesFeature, false);
      parser.setFeature(Parser.defaultAttributesFeature, true);
      parser.setContentHandler(x);
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

      bytes = xhtml.getBytes("UTF-8");

      InputStream in = new ByteArrayInputStream(bytes);
      Parser parser = new Parser();
      HTMLSchema schema = new HTMLSchema();
      parser.setProperty(Parser.schemaProperty, schema);
      Writer w = new StringWriter();
      XMLWriter x = new XMLWriter(w);
      x.setOutputProperty(XMLWriter.METHOD, "xml");
      x.setOutputProperty(XMLWriter.OMIT_XML_DECLARATION, "yes");
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    /**
     * @return the htmlSchema
     */
    public Schema getParsingSchema() {
        if (parsingSchema == null) {
            this.parsingSchema = new HTMLSchema();
        }
        return parsingSchema;
    }
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    /**
     * @return the htmlSchema
     */
    public Schema getParsingSchema() {
        if (parsingSchema == null) {
            this.parsingSchema = new HTMLSchema();
        }
        return parsingSchema;
    }
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    /**
     * @return the htmlSchema
     */
    public Schema getParsingSchema() {
        if (parsingSchema == null) {
            this.parsingSchema = new HTMLSchema();
        }
        return parsingSchema;
    }
View Full Code Here

Examples of org.ccil.cowan.tagsoup.HTMLSchema

    /**
     * @return the htmlSchema
     */
    public Schema getParsingSchema() {
        if (parsingSchema == null) {
            this.parsingSchema = new HTMLSchema();
        }
        return parsingSchema;
    }
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.