Hi All
I have trouble with the logic that shows closest matches in xml file.
Scneraio:
I am accepts some values from the user and checking those values are matching in any xml nodes using xpath. If the node is math then fine, if not match we need to shows closes mathces based on matching parid of each node.
Here is my xml code, the code having hundresd of bod1, body2 nodes. User enter set of values that mathces any one of the body1 node. If there is no match then I need to shows body1, bode2 that are closest matches.
<Head>
<body1>
<node1>1</node1>
<node2>4</node2>
<node3>3</node3>
<node4>0</node4>
<node5>1,2,3,4,5,6,7,12</node5>
<node6>1,2,3,4</node6>
<node7>2</node7>
<node8></node8>
<node9></node9>
<node10>1,2,3,4</node10>
</body1>
<body2>
<node1>2</node1>
<node2>1</node2>
<node3>2</node3>
<node4>0</node4>
<node5>4,5,6,7,12</node5>
<node6>1,2,3,4</node6>
<node7>2</node7>
<node8></node8>
<node9></node9>
<node10>1,2,3,4</node10>
</body2>
<body3>
<node1>1</node1>
<node2>4</node2>
<node3>3</node3>
<node4>0</node4>
<node5>1,2,3,4,5,6,7,12</node5>
<node6>1,2,3,4</node6>
<node7>2</node7>
<node8></node8>
<node9></node9>
<node10>1,2,3,4</node10>
</body3>
<body4>
<node1>2</node1>
<node2>1</node2>
<node3>2</node3>
<node4>0</node4>
<node5>4,5,6,7,12</node5>
<node6>1,2,3,4</node6>
<node7>2</node7>
<node8></node8>
<node9></node9>
<node10>1,2,3,4</node10>
</body4>
</head>
Please suggest me.
Thanks in advance