Package nu.validator.htmlparser.sax

Examples of nu.validator.htmlparser.sax.HtmlParser


@SupportedFormat("text/html")
public class HTMLRDFaParser extends ClerezzaRDFaParser {

  @Override
  public XMLReader getReader() {
    HtmlParser reader = new HtmlParser();
    reader.setXmlPolicy(XmlViolationPolicy.ALLOW);
    reader.setXmlnsPolicy(XmlViolationPolicy.ALLOW);
    reader.setMappingLangToXmlLang(false);
    return reader;
  }
View Full Code Here


                    new UsemapChecker(), jingPropertyMap));
            validator = new CombineValidator(validator, new CheckerValidator(
                    new XmlPiChecker(), jingPropertyMap));
        }

        htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setXmlnsPolicy(XmlViolationPolicy.ALTER_INFOSET);
View Full Code Here

    /**
     *
     */
    protected void newHtmlParser() {
        htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setStreamabilityViolationPolicy(XmlViolationPolicy.FATAL);
View Full Code Here

    /**
     *
     */
    protected void newHtmlParser() {
        htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setStreamabilityViolationPolicy(XmlViolationPolicy.FATAL);
View Full Code Here

    private final List<DocumentFragment> fragments = new LinkedList<DocumentFragment>();

    public static List<DocumentFragment> parseAltAdvice()
            throws IOException, SAXException {
        HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALTER_INFOSET);
        ImageReportAdviceBuilder handler = new ImageReportAdviceBuilder();
        parser.setContentHandler(handler);
        InputSource in = new InputSource(
                ImageReportAdviceBuilder.class.getClassLoader().getResourceAsStream(
                        "nu/validator/localentities/files/wiki_whatwg_org_wiki_Validator_nu_alt_advice"));
        parser.parse(in);
        return handler.getFragments();
    }
View Full Code Here

    private Map<Name, DocumentFragment> attributesByElement = new HashMap<Name, DocumentFragment>();

    private boolean ignoreTextNodes = false;

    public static Spec parseSpec(InputSource in) throws IOException, SAXException {
        HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALTER_INFOSET);
        Html5SpecBuilder handler = new Html5SpecBuilder();
        parser.setContentHandler(handler);
        parser.parse(in);
        return handler.buildSpec();
    }
View Full Code Here

                    new UsemapChecker(), jingPropertyMap));
            validator = new CombineValidator(validator, new CheckerValidator(
                    new XmlPiChecker(), jingPropertyMap));
        }

        htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setXmlnsPolicy(XmlViolationPolicy.ALTER_INFOSET);
View Full Code Here

    /**
     *
     */
    protected void newHtmlParser() {
        htmlParser = new HtmlParser();
        htmlParser.setCommentPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentNonXmlCharPolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setContentSpacePolicy(XmlViolationPolicy.ALTER_INFOSET);
        htmlParser.setNamePolicy(XmlViolationPolicy.ALLOW);
        htmlParser.setStreamabilityViolationPolicy(XmlViolationPolicy.FATAL);
View Full Code Here

    private final List<DocumentFragment> fragments = new LinkedList<DocumentFragment>();

    public static List<DocumentFragment> parseAltAdvice()
            throws IOException, SAXException {
        HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALTER_INFOSET);
        ImageReportAdviceBuilder handler = new ImageReportAdviceBuilder();
        parser.setContentHandler(handler);
        InputSource in = new InputSource(
                ImageReportAdviceBuilder.class.getClassLoader().getResourceAsStream(
                        "nu/validator/localentities/files/wiki_whatwg_org_wiki_Validator_nu_alt_advice"));
        parser.parse(in);
        return handler.getFragments();
    }
View Full Code Here

    private TreeBuilder treeBuilder;

    private Map<Class, DocumentFragment> adviceByClass = new HashMap<Class, DocumentFragment>();

    public static Map<Class, DocumentFragment> parseSyntaxDescriptions() throws IOException, SAXException {
        HtmlParser parser = new HtmlParser(XmlViolationPolicy.ALTER_INFOSET);
        Html5AttributeDatatypeBuilder handler = new Html5AttributeDatatypeBuilder();
        parser.setContentHandler(handler);
        InputSource in = new InputSource(
                Html5AttributeDatatypeBuilder.class.getClassLoader().getResourceAsStream(
                        "nu/validator/localentities/files/wiki_whatwg_org_wiki_MicrosyntaxDescriptions"));
        parser.parse(in);
        return handler.getAdvice();
    }
View Full Code Here

TOP

Related Classes of nu.validator.htmlparser.sax.HtmlParser

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.