2013-03-28 1 views
0

안녕하세요 여러분, 안녕하세요.Android : HTML 코드가 포함 된 XML 파일 읽기

<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"> 
<channel> 
<item> 
<cache>0</cache> 
<id>v_article_16337.html</id> 
<article_id>16337</article_id> 
<type>article</type> 
<img> 
http://website.com/main/image.jpg 
</img> 
<filename> 
http://website.com/other/image.jpg 
</filename> 
<origine_filename> 
http://website.com/image.jpg 
</origine_filename> 
<title> 
<![CDATA[ 
Here plain text 
]]> 
</title> 

<datePub> 
<![CDATA[ 28.03.2013 | 08h00 | ]]> 
</datePub> 
<nbrComment>0</nbrComment> 
<lastComment> 
<![CDATA[ ]]> 
</lastComment> 
<theSameCategorie> 
<![CDATA[ 
Here HTML Code 
]]> 
</theSameCategorie> 
<description> 
<![CDATA[ 
Here plain text 
]]> 
</description> 
<content> 
<![CDATA[ 

Here html code 
]]> 
</content> 
</item> 
</channel> 
</rss> 

내가 어떤 인터넷 있다면 나중에 볼 수 있도록 모든 정보를 구문 분석 및 로컬 파일에 저장하는 방법이 필요합니다 나는 그런 양식 xml 파일 "feed.xml"가 연결이 가능합니다. CDATA 태그가 있으면 값이 무시된다는 것을 알았습니다! 감사합니다.

답변

0

아무리 많은 숫자라도 상관없이 모든 어린이를 반복하고 전체 결과를 얻기 위해 값을 연결하거나 CDATA 내에서 일반 텍스트와 텍스트를 구별하는 것이 중요하지 않은 경우 문서 빌더 팩토리에서 coalescing 속성을 먼저 설정하십시오.

DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance(); 
docFactory.setCoalescing(true);