Hi All
I have spent close to two days struggling to find a element matching a value.
my xml looks like this :
<xml>
<qdbapi>
<record>
<sku_plant>abcd</sku_plant>
<sku>ab</sku>
<plant>cd</plant>
</record>
<record>
<sku_plant>efgh</sku_plant>
<sku>ef</sku>
<plant>gh</plant>
</record>
<record>
<sku_plant>ijkl</sku_plant>
<sku>ij</sku>
<plant>kl</plant>
</record>
</qdbapi>
</xml>
I am trying to use xmlfinaldoc.find( ) like following, but it gets all sku_plant, rather than the one which i want;
var x='/qdbapi/record/sku_plant/text()[contains(.,efgh)]';
var arr = xmlFinalDoc.find(x);
The array arr returns all the element and not the one i want. Where am i going wrong ? How can i find the object record which has a sku_plant (efgh). In my design sku_plant is unique across all records.
thanks
dinesh