org.ccil.cowan.tagsoup.Parser.setFeature()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(2.9k)|赞(0)|评价(0)|浏览(108)

本文整理了Java中org.ccil.cowan.tagsoup.Parser.setFeature()方法的一些代码示例,展示了Parser.setFeature()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Parser.setFeature()方法的具体详情如下:
包路径:org.ccil.cowan.tagsoup.Parser
类名称:Parser
方法名:setFeature

Parser.setFeature介绍

暂无

代码示例

代码示例来源:origin: org.ccil.cowan.tagsoup/tagsoup

  1. public void setFeature(String name, boolean value)
  2. throws SAXNotRecognizedException, SAXNotSupportedException
  3. {
  4. parser.setFeature(name, value);
  5. }

代码示例来源:origin: apache/tika

  1. org.ccil.cowan.tagsoup.Parser.schemaProperty, schema);
  2. parser.setFeature(
  3. org.ccil.cowan.tagsoup.Parser.ignoreBogonsFeature, true);

代码示例来源:origin: com.github.livesense/org.liveSense.service.xssRemove

  1. /**
  2. * Creates a DeXSSParser with the following feature set:
  3. * <ul>
  4. * <li>{@link DeXSSFilterPipeline#BODY_ONLY} <code>true</code></li>
  5. * </ul>
  6. * And uses as parent a {@link org.ccil.cowan.tagsoup.Parser} with the following feature set:
  7. * <ul>
  8. * <li>{@link org.ccil.cowan.tagsoup.Parser#ignoreBogonsFeature} <code>true</code></li>
  9. * <li>{@link org.ccil.cowan.tagsoup.Parser#defaultAttributesFeature} <code>false</code></li>
  10. * </ul>
  11. * TODO: Should be made more configurable.
  12. */
  13. public DeXSSParser() throws SAXNotRecognizedException, SAXNotSupportedException {
  14. super();
  15. setFeature(DeXSSFilterPipeline.BODY_ONLY, true);
  16. Parser parser = new Parser();
  17. parser.setFeature(Parser.ignoreBogonsFeature, true);
  18. parser.setFeature(Parser.defaultAttributesFeature, false);
  19. setParent(parser);
  20. }
  21. }

代码示例来源:origin: net.sf.ofx4j/ofx4j

  1. public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
  2. Parser parser = new Parser();
  3. try {
  4. parser.setFeature(Parser.restartElementsFeature, false);
  5. }
  6. catch (Exception e) {
  7. throw new OFXParseException(e);
  8. }
  9. parser.setContentHandler(new TagSoupHandler(getContentHandler()));
  10. try {
  11. parser.parse(new InputSource(reader));
  12. }
  13. catch (SAXException e) {
  14. if (e.getCause() instanceof OFXParseException) {
  15. throw (OFXParseException) e.getCause();
  16. }
  17. throw new OFXParseException("Error parsing OFX document.", e);
  18. }
  19. }

代码示例来源:origin: stoicflame/ofx4j

  1. public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
  2. Parser parser = new Parser();
  3. try {
  4. parser.setFeature(Parser.restartElementsFeature, false);
  5. }
  6. catch (Exception e) {
  7. throw new OFXParseException(e);
  8. }
  9. parser.setContentHandler(new TagSoupHandler(getContentHandler()));
  10. try {
  11. parser.parse(new InputSource(reader));
  12. }
  13. catch (SAXException e) {
  14. if (e.getCause() instanceof OFXParseException) {
  15. throw (OFXParseException) e.getCause();
  16. }
  17. throw new OFXParseException("Error parsing OFX document.", e);
  18. }
  19. }

代码示例来源:origin: com.github.livesense/org.liveSense.service.xssRemove

  1. parser.setFeature(Parser.defaultAttributesFeature, false);
  2. parser.setFeature(Parser.useAttributes2Feature, true);

代码示例来源:origin: org.apache.tika/tika-parsers

  1. org.ccil.cowan.tagsoup.Parser.schemaProperty, schema);
  2. parser.setFeature(
  3. org.ccil.cowan.tagsoup.Parser.ignoreBogonsFeature, true);

相关文章