두 개의 네임 스페이스가 포함 된 XML 파일에서 일부 데이터를 가져옵니다. 중첩 클래스를 사용하여 다른 수준의 데이터를 가져옵니다. 불행히도 내부 클래스의 데이터에 액세스 할 수 없습니다. 문제는 네임 스페이스에 관한 것이지만 내부 클래스를 수정하지 않고 어떻게 해결할 수 있는지 알지 못합니다. 누구도 XDocument에서 네임 스페이스를 해결할 수있는 방법을 알고 있습니다. 당신은 어떻게 네임 스페이스를 참조하는 파서를 알려줄 필요가XDocument에서 네임 스페이스 확인하기 C#
<TransXChange xmlns="http://www.transxchange.org.uk/"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:apd="http://www.govtalk.gov.uk/people/AddressAndPersonalDetails"
xsi:schemaLocation="http://www.transxchange.org.uk/ http://www.transxchange.org.uk/schema/2.1/TransXChange_registration.xsd"
xml:lang="en" CreationDateTime="2004-06-09T14:20:00-05:00"
>
<Operators>
<LicensedOperator id="O1" >
<NationalOperatorCode>ABC</NationalOperatorCode>
<OperatorAddresses>
<CorrespondenceAddress>
<apd:Line>45 City Road</apd:Line>
</CorrespondenceAddress>
</OperatorAddresses>
</LicensedOperator>
</Operators>
</TransXChange>
여기에 간단한 검색 결과가 나와 있습니다. – BrokenGlass