0

下面是我想要获取元素 co:isbn 不可用的条目的 XML 结构:-

<tr:trackingRecord xmlns:tr="https://www.mla.org/Schema/Tracking/tr"
    xmlns:co="https://www.mla.org/Schema/commonModule/co"
    xmlns:r="http://www.rsuitecms.com/rsuite/ns/metadata">
    <tr:journal>
        <tr:trackingDetails>
            <tr:entry>
                <co:trackingEntryID>2015323313</co:trackingEntryID>
                <co:publicationDate>2015</co:publicationDate>
                <co:volume>21</co:volume>
            </tr:entry>
            <tr:entry>
                <co:trackingEntryID>2015323314</co:trackingEntryID>
                <co:publicationDate>2015</co:publicationDate>
                <co:isbn>
                    <co:entry>NA</co:entry>
                    <co:value>1234567890128</co:value>
                </co:isbn>
            </tr:entry>
            <tr:entry>
                <co:trackingEntryID>2015323315</co:trackingEntryID>
                <co:publicationDate>2015</co:publicationDate>
                <co:volume>21</co:volume>
                <co:isbn></co:isbn>
            </tr:entry>
            <tr:entry>
                <co:trackingEntryID>2015323316</co:trackingEntryID>
                <co:publicationDate>2015</co:publicationDate>
                <co:volume>21</co:volume>
            </tr:entry>
        </tr:trackingDetails>
    </tr:journal>
</tr:trackingRecord>

请建议 cts:query 相同。

4

1 回答 1

0

如果您可以编辑 xml 结构,请在 entry 元素中添加一个属性,例如

<tr:entry isbnPresent="yes"> for isbn present,
<tr:entry isbnPresent="no"> for isbn absent

并基于这些野外火灾搜索,

cts:element-attribute-value

在上面。

或者

不编辑模式,尝试喜欢,,

for $i in cts:search(//tr:entry,"2015")
return if(fn:exists($i//co:isbn)) then () else $i
于 2017-04-07T05:30:39.483 回答