【发布时间】:2018-08-28 12:49:50
【问题描述】:
我有以下 XML,我正在尝试获取等于 974 的“MarcEntryInfo”元素值,有人知道这是如何使用 XDocument 表达的吗?
在我的 C# 代码中,我尝试获取该值,但似乎无法检索该值。
另一种表达我要问的方式是,如果 MarcEntryInfo 的子标签具有特定值的 entryID,则返回该特定 MarcEntryInfo 的文本子元素的字符串值。
谢谢
<LookupTitleInfoResponse xmlns="http://schemas.sirsidynix.com/symws/standard">
<TitleInfo>
<titleID>4971729</titleID>
<CallInfo>
<libraryID>PRODUCT</libraryID>
<classificationID>ALPHANUM</classificationID>
<callNumber>WS6689</callNumber>
<numberOfCopies>1</numberOfCopies>
<ItemInfo>
<itemID>4971729-1001</itemID>
<itemTypeID>TAPE</itemTypeID>
<currentLocationID>STORE</currentLocationID>
<homeLocationID>STORE</homeLocationID>
<chargeable>true</chargeable>
<fixedTimeBooking>false</fixedTimeBooking>
</ItemInfo>
</CallInfo>
<BibliographicInfo>
<MarcEntryInfo>
<label>MD-ARK</label>
<entryID>974</entryID>
<indicators></indicators>
<text>ark:/81055/vdc_100000006155.0x2afcee</text>
<entryTypeCodes>L</entryTypeCodes>
</MarcEntryInfo>
<MarcEntryInfo>
<label>L-ARK: INGESTED</label>
<entryID>975</entryID>
<indicators></indicators>
<text>ark:/81055/vdc_100055625567.0x000002</text>
<entryTypeCodes>L</entryTypeCodes>
</MarcEntryInfo>
<MarcEntryInfo>
<label>SHELFMARK</label>
<entryID>087</entryID>
<indicators></indicators>
<text>WS6689</text>
<entryTypeCodes>VR</entryTypeCodes>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Unpublished series</label>
<entryID>441</entryID>
<indicators></indicators>
<text>Wildlife species reels</text>
<entryTypeCodes>MTR</entryTypeCodes>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Other ref. no.</label>
<entryID>091</entryID>
<indicators></indicators>
<text>W Melanogrammus aeglefinus r1</text>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Product title</label>
<entryID>499</entryID>
<indicators></indicators>
<text>Melanogrammus aeglefinus r1</text>
<entryTypeCodes>MAR</entryTypeCodes>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Format</label>
<entryID>310</entryID>
<indicators></indicators>
<text>1 tape reel</text>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Cataloguing status</label>
<entryID>971</entryID>
<indicators></indicators>
<text>prc</text>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Data source</label>
<entryID>976</entryID>
<indicators></indicators>
<text>WSF</text>
</MarcEntryInfo>
<MarcEntryInfo>
<label>Content code</label>
<entryID>312</entryID>
<indicators></indicators>
<text>a</text>
<entryTypeCodes>L</entryTypeCodes>
</MarcEntryInfo>
</BibliographicInfo>
</TitleInfo>
</LookupTitleInfoResponse>
【问题讨论】:
标签: c# .net xml linq linq-to-xml