我有看起来像的xml
<MeasureSet>
<MeasureSetType val_type="name">Variant</MeasureSetType>
<Measure>
<MeasureType val_type="name">single nucleotide variant</MeasureType>
<AttributeSet>
<MeasureAttributeType val_type="name">HGVS</MeasureAttributeType>
<Attribute>NM_000054.4:c.838dupT</Attribute>
</AttributeSet>
<Citation>
<CitationType val_type="name">general</CitationType>
<ID Source="PubMed">10820168</ID>
</Citation>
<Citation>
<CitationType val_type="name">general</CitationType>
<ID Source="PubMed" />
</Citation>
<Citation>
<CitationType val_type="name">general</CitationType>
<ID Source="PubMed">9773787</ID>
</Citation>
<Citation>
<CitationType val_type="name">general</CitationType>
<ID Source="PubMed">18726898</ID>
</Citation>
<Citation>
<CitationType val_type="name">general</CitationType>
<ID Source="PubMed" />
</Citation>
</Measure>
</MeasureSet>
我想删除具有 Citation/ID/@Source = "PubMed" 且 Citation/ID 为空的 Citation 元素节点
这只会删除 ID 元素,但会删除正确的元素
SET @myBlob.modify('delete //Citation/ID[@Source = ''PubMed''
and string-length(string(number(.))) = 0]')
这会删除所有引文元素
SET @myBlob.modify('delete //Citation[ID/@Source = ''PubMed''
and string-length(string(number(.))) = 0]')
似乎应该有一个我没有想到的简单解决方案。有什么建议么?谢谢