Package com.google.caja.parser.html

Examples of com.google.caja.parser.html.Namespaces


  }
 
  private DomParser getDomParser(String source, final MessageQueue mq) throws ParseException {
    InputSource is = getInputSource();
    HtmlLexer lexer = new HtmlLexer(CharProducer.Factory.fromString(source, is));
    final Namespaces ns = Namespaces.HTML_DEFAULT;  // Includes OpenSocial
    final boolean needsDebugData = needsDebugData();
    DomParser parser = new DomParser(lexer, is, ns, mq);
    parser.setDomImpl(documentFactory);
    parser.setWantsComments(true);
    parser.setNeedsDebugData(needsDebugData);
View Full Code Here


  private DomParser getDomParser(String source, final MessageQueue mq) throws ParseException {
    InputSource is = getInputSource();
    HtmlLexer lexer = new HtmlLexer(CharProducer.Factory.fromString(source, is));
    TokenQueue<HtmlTokenType> tokenQueue = new TokenQueue<HtmlTokenType>(lexer, is);
    final Namespaces ns = Namespaces.HTML_DEFAULT;  // Includes OpenSocial
    final boolean needsDebugData = needsDebugData();

    // OpenSocial Tempates need to be parsed as XML since tags can be self-closing.
    final boolean asXml =
        (source.startsWith(OSML_DATA_START) || source.startsWith(OSML_TEMPLATE_START));
View Full Code Here

  private DomParser getDomParser(String source, final MessageQueue mq) throws ParseException {
    InputSource is = getInputSource();
    HtmlLexer lexer = new HtmlLexer(CharProducer.Factory.fromString(source, is));
    TokenQueue<HtmlTokenType> tokenQueue = new TokenQueue<HtmlTokenType>(lexer, is);
    final Namespaces ns = Namespaces.HTML_DEFAULT;  // Includes OpenSocial
    final boolean needsDebugData = needsDebugData();

    // OpenSocial Tempates need to be parsed as XML since tags can be self-closing.
    final boolean asXml =
        (source.startsWith(OSML_DATA_START) || source.startsWith(OSML_TEMPLATE_START));
View Full Code Here

  }
 
  private DomParser getDomParser(String source, final MessageQueue mq) throws ParseException {
    InputSource is = getInputSource();
    HtmlLexer lexer = new HtmlLexer(CharProducer.Factory.fromString(source, is));
    final Namespaces ns = Namespaces.HTML_DEFAULT;  // Includes OpenSocial
    final boolean needsDebugData = needsDebugData();
    DomParser parser = new DomParser(lexer, /* wantsComments */ true, is, ns, mq);
    parser.setDomImpl(documentFactory);
    parser.setNeedsDebugData(needsDebugData);
    return parser;
View Full Code Here

      out.add(Token.instance(">", HtmlTokenType.TAGEND, epos));
    }
  }

  private static String tagName(Element e) {
    Namespaces ns = Namespaces.COMMON.forUri(e.getNamespaceURI());
    String prefix = ns != null ? ns.prefix : "";
    String localName = e.getLocalName();
    return "".equals(prefix) ? localName : prefix + ":" + localName;
  }
View Full Code Here

      if (colon < 0) {  // Don't warn if no prefix
        return defaultNsUri;
      }
      MessageLevel level;
      String prefix = xmlIdent.substring(0, colon);
      Namespaces ns = Namespaces.HTML_DEFAULT.forPrefix(prefix);
      String nsUri;
      if (ns == null) {
        level = PluginMessageType.MISSING_XML_NAMESPACE.getLevel();
        nsUri = "http://example.net/unknown-xml-namespace/";
      } else {
View Full Code Here

        new Message(
            IhtmlMessageType.BAD_ATTRIB,
            FilePosition.instance(is, 2, 63, 25, 13),
            elKey("ihtml:call"),
            AttribKey.forAttribute(
                new Namespaces(Namespaces.XML_SPECIAL, "baz", "unknown:///baz"),
                elKey("ihtml:call"), "baz:boo"),
            MessagePart.Factory.valueOf("far")),
        new Message(
            MessageType.NO_SUCH_NAMESPACE,
            FilePosition.fromLinePositions(is, 2, 25, 2, 32),
View Full Code Here

TOP

Related Classes of com.google.caja.parser.html.Namespaces

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.