2011-06-13 100 views
1

在我的GWT项目我解析XML文件:XML解析工作与Chrome和Firefox,但无法在Internet Explorer

Document document = XMLParser.parse(xmlString); 

在Chrome和Firefox的一切都很好。 XML被成功解析并且检索到的数据是有效的。但Internet Explorer 9上面的行失败,但以下例外:

com.google.gwt.xml.client.impl.DOMParseException: Failed to parse: <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> 
<parsedVolcanoes> 
<volcano> 
<title>Vulkan Arenal in Costa Rica</t 

任何提示可能是什么问题,高度赞赏!我知道给定的信息很少,所以请询问是否需要更多信息。

我能解决这个问题。 xmlString中有一个0xffff字符。删除可修复问题。这里是代码:

// remove invalid characters from xml 
xmlString = xmlString.replaceAll("\\uffff", ""); 

// parse the XML document into a DOM 
Document document = XMLParser.parse(xmlString); 

回答

相关问题