2010-03-02 70 views
0

在我的應用程序中,ROME api嘗試驗證W3C中的反饋和DTD,並且在W3C阻止該IP後一段時間失敗。Rome RSS - 在羅馬禁用驗證RSS

有沒有一種方法可以禁用ROME中的XML提要驗證?

RSS XML驗證時並不需要,因爲我們從一個知名的公司獲得飼料

回答

2

你可以試試這個?

// create a Document from inputstream is 
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); 
DocumentBuilder builder = factory.newDocumentBuilder(); 
Document doc = builder.parse(is); 

// fetch the feed 
SyndFeedInput input = new SyndFeedInput(); 
SyndFeed feed = input.build(doc); 

的思想是首先解析XML到文檔,然後傳遞該文檔到SyndFeedInput。使用DocumentBuilder解析不會針對DTD進行驗證。

+0

感謝sdb的回覆。但是,錯誤是由遠程服務器啓動的一些驗證引起的,ROME與此無關。 – budsiya 2010-03-05 00:14:46