0
노드 트리를 구문 분석 할 때 문제가 발생했습니다. 여기에 내가 함께 일하고 무엇의 예를 들어 XML 문서는 다음과 같습니다형제에 따라 트리에서 노드 선택
<result>
<type>street_address</type>
<formatted_address>Krasickiego 6, 83-020 Cedry Wielkie, Poland</formatted_address>
<address_component>
<long_name>6</long_name>
<short_name>6</short_name>
<type>street_number</type>
</address_component>
<address_component>
<long_name>Krasickiego</long_name>
<short_name>Krasickiego</short_name>
<type>route</type>
</address_component>
<address_component>
<long_name>Cedry Wielkie</long_name>
<short_name>Cedry Wielkie</short_name>
<type>locality</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Gmina Cedry Wielkie</long_name>
<short_name>Gmina Cedry Wielkie</short_name>
<type>administrative_area_level_3</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Gdańsk County</long_name>
<short_name>Gdańsk County</short_name>
<type>administrative_area_level_2</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Pomeranian Voivodeship</long_name>
<short_name>Pomeranian Voivodeship</short_name>
<type>administrative_area_level_1</type>
<type>political</type>
</address_component>
<address_component>
<long_name>Poland</long_name>
<short_name>PL</short_name>
<type>country</type>
<type>political</type>
</address_component>
<address_component>
<long_name>83-020</long_name>
<short_name>83-020</short_name>
<type>postal_code</type>
</address_component>
</result>
내가 국가 코드 (PL)이 트리에서 우편 번호 (83-020)를 싶어. 나는 "country"와 "postal_code"라는 텍스트가 포함 된 노드를 트리에서 검색하고 올바른 이름을 가진 형제 노드를 가져올 수 있다고 생각합니다 (예 : "country"를 검색하고 "short_name"이라는 형제 노드를 가져옵니다). 그러나 나는 어떻게 확신 할 수 없다. 올바른 방향으로 도움을받을 수 있을까요? 나는 C#에서 일하고 XPath를 사용하고있다.
를하시기 바랍니다 시도한 내용과 정확히 쿼리가 실패한 부분을 보여주는 코드를 추가하십시오. 이렇게하면 전문가가 귀하의 질문에 더 잘 답변 할 수 있습니다. 지침은 [this] (http://stackoverflow.com/help/how-to-ask)를 참조하십시오. 감사! – metacubed