我有一個xml文件,我想查詢使用索引路徑。我不確定這是否可能,但非常感謝任何幫助!使用索引路徑查詢XMl
所以我在找的是能夠用這樣的路徑查詢XML文件。
ReturnState [0] \ ReturnDataState [0] \ Form6 [0] \車身[0] \會員[0] \ FormA1
應該給我的第一個成員元素下的FormA1。這種方法有很多原因,並且沒有深入細節,我想知道是否可以使用xpath或其他方式查詢這樣的內容。
<ReturnState>
<ReturnDataState>
<Form6>
<Body>
<Member>
<MemberName>
<BusinessNameLine1Txt>Mouser0</BusinessNameLine1Txt>
</MemberName>
<FormA1>
<PartI-SalesFactor>
<SalesDelOrShippedOutState>31754631</SalesDelOrShippedOutState>
<TotalSales>
<Wisconsin>31754631</Wisconsin>
<TotalCompany>1965873635</TotalCompany>
</TotalSales>
<SalesFactorTotal>
<Wisconsin>31754631</Wisconsin>
<TotalCompany>1965873635</TotalCompany>
</SalesFactorTotal>
<ApportionmentPercentage>0.000000</ApportionmentPercentage>
</PartI-SalesFactor>
</FormA1>
</Member>
<Member>
<MemberName>
<BusinessNameLine1Txt>Mouser1</BusinessNameLine1Txt>
</MemberName>
<FormA1>
<PartI-SalesFactor>
<SalesDelOrShippedOutState>31754632</SalesDelOrShippedOutState>
<TotalSales>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>1965873633</TotalCompany>
</TotalSales>
<SalesFactorTotal>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>196587344</TotalCompany>
</SalesFactorTotal>
<ApportionmentPercentage>1.000000</ApportionmentPercentage>
</PartI-SalesFactor>
</FormA1>
</Member>
<Member>
<MemberName>
<BusinessNameLine1Txt>Mouser2</BusinessNameLine1Txt>
</MemberName>
<FormA1>
<PartI-SalesFactor>
<SalesDelOrShippedOutState>31754632</SalesDelOrShippedOutState>
<TotalSales>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>1965873633</TotalCompany>
</TotalSales>
<SalesFactorTotal>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>196587344</TotalCompany>
</SalesFactorTotal>
<ApportionmentPercentage>1.000000</ApportionmentPercentage>
</PartI-SalesFactor>
</FormA1>
</Member>
<Member>
<MemberName>
<BusinessNameLine1Txt>Mouser3</BusinessNameLine1Txt>
</MemberName>
<FormA1>
<PartI-SalesFactor>
<SalesDelOrShippedOutState>31754632</SalesDelOrShippedOutState>
<TotalSales>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>1965873633</TotalCompany>
</TotalSales>
<SalesFactorTotal>
<Wisconsin>31754632</Wisconsin>
<TotalCompany>196587344</TotalCompany>
</SalesFactorTotal>
<ApportionmentPercentage>1.000000</ApportionmentPercentage>
</PartI-SalesFactor>
</FormA1>
</Member>
</Body>
</Form6>
</ReturnDataState>
</ReturnState>
感謝, AJ
你真的認爲你的標題說XMI(而不是XML)? – DeanOC
我只問XMI是一個有效的標籤,如果它不是一個錯字,那麼你應該添加標籤到你的問題。 – DeanOC