Java中XML文件的解析問題(已解決)

2021-04-29 12:26:58 字數 947 閱讀 3985

這兩天在練習struts1.2+hibernate3.1在myeclipse5.1下的程式設計。

中間就遇到了乙個對rss xml文件進行解析的問題。

核心解析**如下:

public static list parsefeed(string address)

}catch (parserconfigurationexception e)

catch (saxexception e)

catch (ioexception e) finally

//return result;

}

但結果卻是返回null空值。我檢視了一直這一語句:

documentbuilde***ctory dbf = documentbuilde***ctory.newinstance();

中dbf的值為:

com.sun.org.apache.xerces.internal.jaxp.documentbuilde***ctoryimpl@8f4fb3

在elseif的專欄中有專門討論這個問題的(url:http://blog.csdn.net/elseif/archive/2005/04/29/367506.aspx)

但可惜的是我用的jdk1.5.0_06沒有包org.apache.crimson.jaxp.documentbuilde***ctoryimpl(在我那如果有完整路徑應該是com.sun.org.apache.crimson.jaxp.documentbuilde***ctoryimpl),但是確實沒有這樣的類。因為根本找不到com.sun.org.apache.crimson.*這個包,我想是不是我的jdk的問題,正在尋找解決之道。。。。

iOS中XML文件解析

1 讀取檔案路徑 nsstring path nsbundle mainbundle pathforresource student oftype txt 2 讀取資料 nsdata data nsdata datawithcontentoffile path 1 開始xml sax解析,需要遵循n...

xml文件解析

import gdataxmlnode.h 建立xml文件 取出所有 promotion節點 nsarray array document nodesforxpath promotion error nil 建模 for gdataxmlelement element inarray 使用gdata...

xml文件解析

xml文件解析 what xml文件用來存放資料,這些資料需要被程式傳遞使用 但xml的語法有別於使用它的語言的語法,所以需將xml儲存的資料轉換成使用它語言能識別的資料,這個過程叫xml解析 do xml文件在各語言基礎上定義一致,且解析邏輯一致,故用於 各語言間資料傳輸 xml的三種解析規則 d...