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

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

本文整理了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

public void setFeature(String name, boolean value)
  throws SAXNotRecognizedException, SAXNotSupportedException
{
  parser.setFeature(name, value);
}

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

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

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

/**
  * Creates a DeXSSParser with the following feature set:
  * <ul>
  * <li>{@link DeXSSFilterPipeline#BODY_ONLY} <code>true</code></li>
  * </ul>
  * And uses as parent a {@link org.ccil.cowan.tagsoup.Parser} with the following feature set:
  * <ul>
  * <li>{@link org.ccil.cowan.tagsoup.Parser#ignoreBogonsFeature} <code>true</code></li>
  * <li>{@link org.ccil.cowan.tagsoup.Parser#defaultAttributesFeature} <code>false</code></li>
  * </ul>
  * TODO: Should be made more configurable.
  */
 public DeXSSParser() throws SAXNotRecognizedException, SAXNotSupportedException {
  super();
  setFeature(DeXSSFilterPipeline.BODY_ONLY, true);
  Parser parser = new Parser();
  parser.setFeature(Parser.ignoreBogonsFeature, true);
  parser.setFeature(Parser.defaultAttributesFeature, false);
  setParent(parser);
 }
}

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

public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
 Parser parser = new Parser();
 try {
  parser.setFeature(Parser.restartElementsFeature, false);
 }
 catch (Exception e) {
  throw new OFXParseException(e);
 }
 parser.setContentHandler(new TagSoupHandler(getContentHandler()));
 try {
  parser.parse(new InputSource(reader));
 }
 catch (SAXException e) {
  if (e.getCause() instanceof OFXParseException) {
   throw (OFXParseException) e.getCause();
  }
  
  throw new OFXParseException("Error parsing OFX document.", e);
 }
}

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

public void parseV1FromFirstElement(Reader reader) throws IOException, OFXParseException {
 Parser parser = new Parser();
 try {
  parser.setFeature(Parser.restartElementsFeature, false);
 }
 catch (Exception e) {
  throw new OFXParseException(e);
 }
 parser.setContentHandler(new TagSoupHandler(getContentHandler()));
 try {
  parser.parse(new InputSource(reader));
 }
 catch (SAXException e) {
  if (e.getCause() instanceof OFXParseException) {
   throw (OFXParseException) e.getCause();
  }
  
  throw new OFXParseException("Error parsing OFX document.", e);
 }
}

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

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

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

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

相关文章