org.xml.sax.helpers.XMLFilterImpl.warning()方法的使用及代码示例

x33g5p2x  于2022-02-02 转载在 其他  
字(1.4k)|赞(0)|评价(0)|浏览(83)

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

XMLFilterImpl.warning介绍

[英]Filter a warning event.
[中]过滤警告事件。

代码示例

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

@Override
  public void warning(SAXParseException e)
  throws SAXException
  {
    _filter.warning(e);
  }
}

代码示例来源:origin: nu.validator/validator

private void checkId(String name, String value) throws SAXException {
  if ("".equals(value)) {
    super.error(new SAXParseException("Attribute \u201C" + name + "\u201D had the empty string as the value but the empty string cannot be used as an ID.", locator));            
    return;
  }
  Locator first = ids.get(value);
  if (first == null) {
    ids.put(value, new LocatorImpl(locator));
  } else {
    super.error(new SAXParseException("Attribute \u201C" + name + "\u201D declares a duplicate ID value \u201C" + value + "\u201D.", locator));
    super.warning(new SAXParseException("The first occurrence of the ID value \u201C" + value + "\u201D was here.", first));
  }
}

代码示例来源:origin: nu.validator/validator

} else if ("ID" == type) {
  String qn = atts2.getQName(i);
  super.warning(new SAXParseException("Unusual attribute \u201C" + qn + "\u201D declared be of type ID. This may be a compatibility problem when the DTD is not processed.", locator));
  checkId(qn, atts2.getValue(i));

相关文章

微信公众号

最新文章

更多