Hi,<br> <br>I have a XML file and I am trying find a specific attribute value from it.<br>The Whole senario is like when I am trying to search any value from the document it gives me a value but not exact which I want.<br>
<br>For eg. If I want to find ABC from document it gives me ABC as well as ABC_A, ABCD etc. but I want only ABC.<br> <br>So, How can I retrive exact result.<br> <br>Here is one Example which I tried.<br> <br>My XML file <br>
<br><doc><br><result id="instance" href="abc"><br><hi>val1</hi><br><new>val2</new><br></result><br><result id="instance1" href="abc"><br>
<hi>val1</hi><br><new>val2</new><br></result><br><result id="instance1" href="abcds"><br><hi>val1</hi><br><new>val2</new><br></result><br>
</doc> <br> <br>XQuery<br> <br>declare variable $docs2 external; <br>let $docs2 := doc("D:/try.xml")/doc<br>for $x in $docs2<br>where $x/result[@href = 'abc']<br>return $x <br> <br>And Result is as under <br>
<br><doc><br><result id="instance" href="abc"><br><hi>val1</hi><br><new>val2</new><br></result><br><result id="instance1" href="abc"><br>
<hi>val1</hi><br><new>val2</new><br></result><br><result id="instance1" href="abcds"><br><hi>val1</hi><br><new>val2</new><br></result><br>
</doc> <br> <br> <br>Thanks & Regards,<br clear="all"><br>-- <br>
<div style="TEXT-ALIGN: left"><font color="#9999ff"><strong>Kunal Chauhan</strong></font></div>
<div style="TEXT-ALIGN: left"><a href="mailto:mail4ck@gmail.com" target="_blank"><font color="#9999ff">mail4ck@gmail.com</font></a></div>
<div style="TEXT-ALIGN: left"><font color="#9999ff">[+918655517141]</font></div>
<div style="TEXT-ALIGN: left"><font color="#9999ff">[+919904983614]</font></div><br>