"베를린의 역사"를 검색하면 URL을 요청하고 있습니다.
그리고 당신은 다음과 같은 XML 결과를 돌려 받고 있습니다.
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfResult
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns="http://lookup.dbpedia.org/">
<Result>
<Label>Museum für Naturkunde</Label>
<URI>http://dbpedia.org/resource/Museum_für_Naturkunde</URI>
<Description></Description>
<Classes></Classes>
<Categories></Categories>
<Templates></Templates>
<Redirects></Redirects>
<Refcount>155</Refcount>
</Result>
<Result>
<Label>History of Berlin</Label>
<URI>http://dbpedia.org/resource/History_of_Berlin</URI>
<Description>
Berlin is the capital city of Germany. Berlin is a young city by European standards, founded in the 12th century.
</Description>
<Classes></Classes>
<Categories>
<Category>
<Label>History of Berlin</Label>
<URI>http://dbpedia.org/resource/Category:History_of_Berlin</URI>
</Category>
<Category>
<Label>History of Germany by location</Label>
<URI>http://dbpedia.org/resource/Category:History_of_Germany_by_location</URI>
</Category>
</Categories>
<Templates></Templates>
<Redirects></Redirects>
<Refcount>14</Refcount>
</Result>
</ArrayOfResult>
당신은 옳습니다 URI
카테고리 URI, 예를 들어, 예를 들어,
<URI>http://dbpedia.org/resource/Category:History_of_Berlin</URI>
그러나 주목해야 할 것은 문서의 근원에서
ArrayOfResult/Result/Categories/Category/URI
당신이 원하는 요소는 요소입니다
ArrayOfResult/Result/URI
집단. XML을 조금 다르게 처리하면됩니다. 얻지 마십시오 모두 의 내용 모두 URI
요소, 그러나 URI
자녀 인 요소 Result
집단. 나는 Sax Parsing에 익숙하지는 않지만 중요한 점은 일단 당신이 일단 입력 한 것입니다. Result
, 당신은 만 잡아야합니다 URI
다른 자식 요소에 들어 가지 않았다면 Result
.