Hi
How to write xpath to get matching node based on the node's attributes and childs (if any) attributes
single xml node:
<Nokia_3220.gif jcr:primaryType="nt:file" jcr:uuid="90ff297d-7508-4cc8-8302-71b6e75fb8ba" jcr:created="2014-01-03T04:51:24.377-08:00" jcr:createdBy="admin">
<jcr:content jcr:primaryType="nt:unstructured" country="India" firstName="Supplier" jcr:data="FBAAOw==" jcr:lastModified="2014-01-03T18:21:11.216+05:30" jcr:mimeType="image/gif" lastName="Image1" phone="988-777-5551" state="WB" status="Active"/>
</Nokia_3220.gif>
what would be the xpath query for jcr:uuid and state and firstName and jcr:created all are like search ?
I tried :
string xpath =
"//Nokia_3220.gif[contains(translate(@jcr:uuid, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'90ff297d-7508-4cc8-8302-71b6e75fb8ba')
and contains(translate(@state, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'W')
and contains(translate(@firstName, 'ABCDEFGHIJKLMNOPQRSTUVWXYZ', 'abcdefghijklmnopqrstuvwxyz'),'pplie')]
xmlnodelist list = objDoc.selectnodes(xpath,ns);
my problem is I can't predict , whether a particular attribute belongs to a node itself or it belongs to its child.
How to write xpath to get the node irrespective of the attribute attached to the node or its child, provided the name of the element which contains the attribute for sure
hope , you understand
any suggestions is appreciated.