코드는 IronPython에 있으며 여기에 있습니다.
for systemNode in csResultXML.SelectNodes("Response/SubSystems/SubSystem"):
itemNodes = systemNode.SelectNodes('/SubSystem/Items/Item')
단일 루프 사이클에서 systemNode의 값은 다음과 같습니다.
<SubSystem ID="0">
<Items>
<Item>
<Quantity>1</Quantity>
<TotalPrice>0.0</TotalPrice>
</Item>
<Item>
<Quantity>1</Quantity>
<TotalPrice>0.0</TotalPrice>
</Item>
</Items>
</SubSystem>
itemNodes는 코드가 완료되었을 때 빈 목록입니다.
왜? XPath 온라인 유효성 검사기는 결과를 올바르게 반환합니다.
시간 내 주셔서 감사합니다
문서 노드 의 하위 요소가 아닌 컨텍스트 노드 (사용자 변수) systemNode.SelectNodes('Items/Item')
의 Items
하위 요소 를 선택하려는대로 사용해야 합니다 .systemNode
Items
/
이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.
침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제
몇 마디 만하겠습니다