protected void verifyXmlEncoding(ReaderConfig cfg)
throws XMLStreamException
{
String inputEnc = mInputEncoding;
// Close enough?
if (StringUtil.equalEncodings(inputEnc, mFoundEncoding)) {
return;
}
/* Ok, maybe the difference is just with endianness indicator?
* (UTF-16BE vs. UTF-16)?
*/
// !!! TBI
XMLReporter rep = cfg.getXMLReporter();
if (rep != null) {
Location loc = getLocation();
String msg = MessageFormat.format(ErrorConsts.W_MIXED_ENCODINGS,
new Object[] { mFoundEncoding,
inputEnc });
String type = ErrorConsts.WT_XML_DECL;
/* 30-May-2008, tatus: Should wrap all the info as XMValidationProblem
* since that's Woodstox' contract wrt. relatedInformation field.
*/
XMLValidationProblem prob = new XMLValidationProblem(loc, msg, XMLValidationProblem.SEVERITY_WARNING, type);
rep.report(msg, type, prob, loc);
}
}
ReaderBootstrapper.java 文件源码
java
阅读 23
收藏 0
点赞 0
评论 0
项目:woodstox
作者:
评论列表
文章目录