C# code to relate two nodes
-
I am working with C# windows application. I have html source, which im converting to html node collection using htmlagilitypack. I am parsing through each node and searching for a text. I want to get the relation between two nodes.
For eg:
<div>
<a href="www.google.com"></a>
</div>
<div>
<a href="www.abc.com">structure</a>
</div>
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in other nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? say node2 is sibling or parent or child or descendant of node1.
Please help me...
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in remaining nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? Like node2 is in sibling or parent or child or descendant etc of node1.
Please help me...
-
I am working with C# windows application. I have html source, which im converting to html node collection using htmlagilitypack. I am parsing through each node and searching for a text. I want to get the relation between two nodes.
For eg:
<div>
<a href="www.google.com"></a>
</div>
<div>
<a href="www.abc.com">structure</a>
</div>
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in other nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? say node2 is sibling or parent or child or descendant of node1.
Please help me...
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in remaining nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? Like node2 is in sibling or parent or child or descendant etc of node1.
Please help me...
How do you determine whether a node is a sibling/parent/child of another node? By its location in the same container (div) element? Something else? Not clear to me.
-
How do you determine whether a node is a sibling/parent/child of another node? By its location in the same container (div) element? Something else? Not clear to me.
It can be in the same container or different. I want to relate the nodes. Say node1's parent's sibling is node2 or node1's sibling is node2 or any scenario that gives the connection between the two nodes. For Ex: <div> <node1/> </div> <div> <node2/> </div> node2 is node1's parent's (div1) sibling's (div2) child I hope this is clear.
-
I am working with C# windows application. I have html source, which im converting to html node collection using htmlagilitypack. I am parsing through each node and searching for a text. I want to get the relation between two nodes.
For eg:
<div>
<a href="www.google.com"></a>
</div>
<div>
<a href="www.abc.com">structure</a>
</div>
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in other nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? say node2 is sibling or parent or child or descendant of node1.
Please help me...
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in remaining nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? Like node2 is in sibling or parent or child or descendant etc of node1.
Please help me...
Logically, the only relation between the two is that they are siblings - they are both children of the parent node that encompases them. Neither of these is a parent or child to the other.
-
I am working with C# windows application. I have html source, which im converting to html node collection using htmlagilitypack. I am parsing through each node and searching for a text. I want to get the relation between two nodes.
For eg:
<div>
<a href="www.google.com"></a>
</div>
<div>
<a href="www.abc.com">structure</a>
</div>
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in other nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? say node2 is sibling or parent or child or descendant of node1.
Please help me...
My node1 = <a href="www.google.com"></a>. I will search for text "structure" in remaining nodes and as a result i get node2 = <a href="www.abc.com">structure</a>
Can i relate these two nodes? Like node2 is in sibling or parent or child or descendant etc of node1.
Please help me...
AshwiniSH wrote:
Can i relate these two nodes?
Yes, but how do you determine the relationship? As it stands there is nothing to connect the two nodes, they are just independent URIs; you need to set some rules that specify how they relate to each other.
Veni, vidi, abiit domum