Get Unmatched record using xpath expression in c#
hi ,
var temp = xdocfile.xpathselectelements("//ref[label/text()=translate(@id, 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', '')]");
i want unmatch records using above xpath equation
can please tell me possible ?
in below example,
id , label compulsory,need search unmatched records
input:
<ref id="sec1">see fig test
<label>1</label>
</ref>
<ref id="temp34">see fig test
<label>3</label>
</ref>
<ref id="sec4">see fig test
</ref>
<ref sub="sec4">see fig test </ref>
<ref id="4test">see fig test
<label>4</label>
</ref>
output:
<ref id="temp34">see fig test
<label>3</label>
</ref>
<ref id="4test">see fig test
<label>4</label>
</ref>
i got right expresion:
var varsearchterm = from x in xdocfile.xpathselectelements("//ref[@id , label][translate(@id, '.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz', '')!=translate(./label/text(),'.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz','.abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyz')]
") select x;
Visual Studio Languages , .NET Framework > Visual C#
Comments
Post a Comment