1
저는 XML에 익숙하지 않습니다. 자바 스크립트로 testcomplete를 사용하고 있습니다. 나는 중첩 된 xml 아래에 작은 부분을 붙여 넣습니다.자바 스크립트에서 데이터 추출하기
rowtype category = "ExitRow"직종이 무료 인 경우 rownumber 및 column code를 추출하고 싶습니다. 마케팅 시트 유형이 E입니다.
<Row rowNumber="011">
<RowCharacteristics>
<RowType category="ExitRow"/>
</RowCharacteristics>
<Seats>
<Seat occupation="Free" columnCode="A">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
<Seat occupation="Free" columnCode="B">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="1A"/>
<PhysicalSeatType category="1B"/>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
<Seat occupation="Free" columnCode="C">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="1A"/>
<PhysicalSeatType category="1B"/>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
<Seat occupation="Free" columnCode="D">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="1A"/>
<PhysicalSeatType category="1B"/>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
<Seat occupation="Free" columnCode="E">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="1A"/>
<PhysicalSeatType category="1B"/>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
<Seat occupation="Free" columnCode="F">
<MarketingSeatType category="E"/>
<PhysicalSeatTypes>
<PhysicalSeatType category="1A"/>
<PhysicalSeatType category="1B"/>
<PhysicalSeatType category="E"/>
</PhysicalSeatTypes>
</Seat>
</Seats>
</Row>
테스트 완료시 XML을 열 수있는 코드를 작성했지만 확실하지는 않습니다.
Doc = Sys.OleObject("Msxml2.DOMDocument.4.0");
Doc.async = false;
Doc.load("d:\\MyFile.xml");
Node = Doc.documentElement;
그게 가장 최고 감사 : 여기
당신을 위해 작동해야하는 코드입니다. 실제로 첫 번째 exit 행이 채워질 때 위의 프로그램이 행 번호와 열 이름을 반환하지 않았을 때 둘 이상의 exit 행을가집니다. :(나는 출구 행을 모두 확인했을 것입니다. 어떻게해야할까요? 한 번 더 해보면 여러 승객을위한 무료 좌석을 찾기위한 절차가 반복됩니다. 자리를 사용하면 어떤 식 으로든 자리를 바꿀 수 있습니다 = 차단됨 다음 번에 다시 선택하지 않도록합니다. –작업 var numberofExitRow = Doc.selectNodes ('// Row [RowCharacteristics/RowType/@ category = "ExitRow"]') for (j = 0; j
다음 부분을 알아 내야합니다. 사용 후 자리가 어떻게 바뀌 었는지 어떻게 표현해야합니까? –